From 9e09c80fef9501f058be5c7c487283e356bea520 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 12 Mar 2013 12:25:22 +0100 Subject: [PATCH] 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 --- README.md | 3 +++ doc/signify.txt | 8 ++++++++ plugin/signify.vim | 16 +++++++++++----- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7689371..e84dbd9 100644 --- a/README.md +++ b/README.md @@ -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 `` diff --git a/doc/signify.txt b/doc/signify.txt index 6251ade..04e8d94 100644 --- a/doc/signify.txt +++ b/doc/signify.txt @@ -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* diff --git a/plugin/signify.vim b/plugin/signify.vim index 35f2bb9..b5adc91 100644 --- a/plugin/signify.vim +++ b/plugin/signify.vim @@ -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(':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(':p'))) + endif + if exists('g:signify_cursorhold_insert') && (g:signify_cursorhold_insert == 1) + autocmd CursorHoldI * write | call s:start(resolve(expand(':p'))) + endif + autocmd ColorScheme * call s:colors_set() + autocmd BufWritePost,BufEnter,FocusGained * call s:start(resolve(expand(':p'))) +augroup END com! -nargs=0 -bar SignifyToggle call s:toggle_signify() com! -nargs=0 -bar SignifyToggleHighlight call s:toggle_line_highlighting()