diff options
Diffstat (limited to 'vim/after/ftplugin/gitcommit.vim')
-rw-r--r-- | vim/after/ftplugin/gitcommit.vim | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 4f57a407..7fab5a92 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -8,6 +8,16 @@ setlocal comments+=n:> setlocal formatoptions+=coqr let b:undo_ftplugin .= '|setlocal comments< formatoptions<' +" Choose the color column depending on non-comment line count +if has('autocmd') && exists('+cursorcolumn') + augroup gitcommit + autocmd CursorMoved,CursorMovedI <buffer> + \ let &l:colorcolumn = gitcommit#CursorColumn() + augroup END + let b:undo_ftplugin .= '|autocmd! gitcommit' + \ . '|augroup! gitcommit' +endif + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_gitcommit_maps') finish @@ -17,6 +27,6 @@ endif nnoremap <buffer> <expr> <LocalLeader>q quote#Quote() nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_' xnoremap <buffer> <expr> <LocalLeader>q quote#Quote() -let b:undo_ftplugin .= '|nunmap <LocalLeader>q' - \ . '|nunmap <LocalLeader>qq' - \ . '|xunmap <LocalLeader>q' +let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q' + \ . '|nunmap <buffer> <LocalLeader>qq' + \ . '|xunmap <buffer> <LocalLeader>q' |