Simplify autocmd setup
This commit is contained in:
parent
bf099a3fe2
commit
88cae56c30
@ -10,6 +10,7 @@ endif
|
|||||||
|
|
||||||
let g:loaded_signify = 1
|
let g:loaded_signify = 1
|
||||||
let g:signify_locked = 0
|
let g:signify_locked = 0
|
||||||
|
let s:realtime = get(g:, 'signify_realtime') && has('patch-7.4.1967')
|
||||||
|
|
||||||
" Init: autocmds {{{1
|
" Init: autocmds {{{1
|
||||||
|
|
||||||
@ -19,26 +20,26 @@ augroup signify
|
|||||||
autocmd QuickFixCmdPre *vimgrep* let g:signify_locked = 1
|
autocmd QuickFixCmdPre *vimgrep* let g:signify_locked = 1
|
||||||
autocmd QuickFixCmdPost *vimgrep* let g:signify_locked = 0
|
autocmd QuickFixCmdPost *vimgrep* let g:signify_locked = 0
|
||||||
|
|
||||||
if get(g:, 'signify_realtime') && has('patch-7.4.1967')
|
autocmd BufWritePost * call sy#start()
|
||||||
autocmd BufEnter,BufWritePost,WinEnter * call sy#start()
|
|
||||||
autocmd CursorHold,CursorHoldI * nested call s:save()
|
if s:realtime
|
||||||
autocmd FocusGained * SignifyRefresh
|
autocmd BufEnter,WinEnter * call sy#start()
|
||||||
else
|
else
|
||||||
autocmd BufRead,BufWritePost * call sy#start()
|
autocmd BufRead * call sy#start()
|
||||||
|
endif
|
||||||
|
|
||||||
if get(g:, 'signify_update_on_bufenter')
|
if get(g:, 'signify_update_on_bufenter')
|
||||||
autocmd BufEnter * nested call s:save()
|
autocmd BufEnter * nested call s:save()
|
||||||
endif
|
endif
|
||||||
if get(g:, 'signify_cursorhold_normal')
|
if s:realtime || get(g:, 'signify_cursorhold_normal')
|
||||||
autocmd CursorHold * nested call s:save()
|
autocmd CursorHold * nested call s:save()
|
||||||
endif
|
endif
|
||||||
if get(g:, 'signify_cursorhold_insert')
|
if s:realtime || get(g:, 'signify_cursorhold_insert')
|
||||||
autocmd CursorHoldI * nested call s:save()
|
autocmd CursorHoldI * nested call s:save()
|
||||||
endif
|
endif
|
||||||
if get(g:, 'signify_update_on_focusgained') && !has('gui_win32')
|
if (s:realtime || get(g:, 'signify_update_on_focusgained')) && !has('gui_win32')
|
||||||
autocmd FocusGained * SignifyRefresh
|
autocmd FocusGained * SignifyRefresh
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Init: commands {{{1
|
" Init: commands {{{1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user