update signs on CursorHold or CursorHoldI

I added 2 new options that are disabled by default. Sign updating can
now be triggered after 'updatetime' miliseconds without keypresses in
either normal or insert mode:

For enabling:

let g:signify_cursorhold_normal = 1
let g:signify_cursorhold_insert = 1
This commit is contained in:
Marco Hinz 2013-03-12 12:25:22 +01:00
parent 8d1397787a
commit 9e09c80fef
3 changed files with 22 additions and 5 deletions

View File

@ -76,6 +76,9 @@ For more info: `:h signify-options`
let g:signify_enable_cvs = 1
let g:signify_cursorhold_normal = 1
let g:signify_cursorhold_insert = 1
## Author
Marco Hinz `<mh.codebro@gmail.com>`

View File

@ -141,6 +141,14 @@ The highlight groups to use with line highlighting.
Enable CVS repo detection.
let g:signify_cursorhold_normal = 1
let g:signify_cursorhold_insert = 1
Additionally trigger sign updates in normal or insert mode after 'updatetime'
miliseconds without any keypresses. This fires only once between keypresses,
thus not every 'updatetime' miliseconds.
==============================================================================
4. Commands *signify-commands*
4. Mappings *signify-mappings*

View File

@ -100,11 +100,17 @@ else
endif
" Initial stuff {{{1
aug signify
au!
au ColorScheme * call s:colors_set()
au BufWritePost,BufEnter,FocusGained * call s:start(resolve(expand('<afile>:p')))
aug END
augroup signify
autocmd!
if exists('g:signify_cursorhold_normal') && (g:signify_cursorhold_normal == 1)
autocmd CursorHold * write | call s:start(resolve(expand('<afile>:p')))
endif
if exists('g:signify_cursorhold_insert') && (g:signify_cursorhold_insert == 1)
autocmd CursorHoldI * write | call s:start(resolve(expand('<afile>:p')))
endif
autocmd ColorScheme * call s:colors_set()
autocmd BufWritePost,BufEnter,FocusGained * call s:start(resolve(expand('<afile>:p')))
augroup END
com! -nargs=0 -bar SignifyToggle call s:toggle_signify()
com! -nargs=0 -bar SignifyToggleHighlight call s:toggle_line_highlighting()