Replace vim-gitgutter with vim-signify

vim-gitgutter is buggy. vim-signify might be better, it does allow
configuration of which events trigger a sign column update and this
patch takes advantage of that. Firstly, the `CursorHold` and
`CursorHoldI` events are disabled and replaced with `InsertLeave` and
`TextChanged` events. This makes the sign column updates immediate, and
since vim-signify is asynchronous it's faster too.
This commit is contained in:
Kenneth Benzie 2021-01-26 23:39:31 +00:00
parent eac02b26d3
commit 9c64158445
5 changed files with 25 additions and 8 deletions

View File

@ -69,7 +69,7 @@ function! do#rename_include_guard(old)
call setpos('.', l:pos) call setpos('.', l:pos)
endfunction endfunction
" Setup and start a debugging command. " Setup and start a debugging command
function! do#debug(...) function! do#debug(...)
packadd termdebug packadd termdebug
let l:command = 'TermdebugCommand' let l:command = 'TermdebugCommand'
@ -86,3 +86,13 @@ function! do#last_change()
norm!`` norm!``
endif endif
endfunction endfunction
" Augment vim-signify update events
function! do#signify() abort
" Disable update on cursor hold
autocmd! signify CursorHold,CursorHoldI
" Enable updates on leaving insert mode
autocmd signify InsertLeave,TextChanged <buffer> call sy#start()
" Enable update on text change e.g. undo/redo
autocmd signify TextChanged <buffer> call sy#start()
endfunction

View File

@ -207,5 +207,9 @@ if has('gui_running') || &t_Co == 256
call s:hi('SyntasticWarningLine', '', '', '') call s:hi('SyntasticWarningLine', '', '', '')
call s:hi('SyntasticError', '160', '', '') call s:hi('SyntasticError', '160', '', '')
call s:hi('SyntasticWarning', '129', '', '') call s:hi('SyntasticWarning', '129', '', '')
call s:hi('SignifySignAdd', '2', '233', '')
call s:hi('SignifySignChange', '3', '233', '')
call s:hi('SignifySignDelete', '1', '233', '')
"" }}} "" }}}
endif endif

View File

@ -25,4 +25,7 @@ augroup benieAugroup
au BufNewFile * silent! call snippet#template() au BufNewFile * silent! call snippet#template()
" Do the same when filetype changes to help " Do the same when filetype changes to help
au FileType help silent! call snippet#template() au FileType help silent! call snippet#template()
" Augment vim-signify by modifying it's autocmds
au User SignifyAutocmds call do#signify()
augroup END augroup END

View File

@ -162,6 +162,11 @@ set mouse=a
" q - allow formatting with 'gq' " q - allow formatting with 'gq'
set formatoptions+=rq set formatoptions+=rq
" Always show the signcolum
if exists('&signcolumn')
set signcolumn=yes
endif
" Enable modeline " Enable modeline
set modeline set modeline

9
vimrc
View File

@ -68,13 +68,8 @@ let g:ale_linters = {'c': [], 'cpp': []}
let g:ale_cmake_cmakelint_options = let g:ale_cmake_cmakelint_options =
\ '-convention/filename,-package/consistency,-package/stdargs' \ '-convention/filename,-package/consistency,-package/stdargs'
" git diff in the sign column " Version control differences in the sign column
Pack 'airblade/vim-gitgutter' Pack 'mhinz/vim-signify'
if exists('&signcolumn')
set signcolumn=yes
else
let g:gitgutter_sign_column_always = 1
endif
" format.vim - format with text objects " format.vim - format with text objects
Pack 'git@bitbucket.org:infektor/format.vim.git' Pack 'git@bitbucket.org:infektor/format.vim.git'