Guest User

Untitled

a guest
Dec 9th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. augroup vimrc-plugin-lingr
  2. autocmd!
  3. autocmd User plugin-lingr-* call s:lingr_event(
  4. \ matchstr(expand('<amatch>'), 'plugin-lingr-\zs\w*'))
  5. augroup END
  6. function! s:lingr_event(event)
  7. if a:event ==# 'message' && exists(':WindowName') == 2
  8. execute printf('WindowName %s(%d)', 'lingr-vim', lingr#unread_count())
  9. endif
  10. endfunction
  11.  
  12. function! s:set_window_name(name)
  13. let esc = "\<ESC>"
  14. silent! execute '!echo -n "' . esc . 'k' . escape(a:name, '%#!')
  15. \ . esc . '\\"'
  16. redraw!
  17. endfunction
  18. command! -nargs=? WindowName call s:set_window_name(<q-args>)
Add Comment
Please, Sign In to add comment