diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-16 09:22:44 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-16 09:22:44 +1200 |
commit | d7491b213b2f0df6da97f2f1c951cb070b9513a5 (patch) | |
tree | a3a2df95aae0f674dd21736a9ab1d13c31de96e4 /vim/after/ftplugin/gitcommit.vim | |
parent | Merge branch 'release/v1.30.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-d7491b213b2f0df6da97f2f1c951cb070b9513a5.tar.gz dotfiles-d7491b213b2f0df6da97f2f1c951cb070b9513a5.zip |
Merge branch 'release/v1.31.0'v1.31.0
* release/v1.31.0:
Bump VERSION
Add shebang_create_exec.vim plugin
Add missing <buffer> to mail quote unmaps
Update plugins
Remove pattern \m where not needed for 'magic'
Simplify/correct Korn shell shebang matching
Use non-capturing groups in VimL where appropriate
Use \= in preference to \+ in VimL patterns
Add plugin file for setting 'wildignore'
Update auto_cache_dirs.vim plugin
Check for +autocmd before gitcommit ftplugin hooks
Adaptive 'colorcolumn' for gitcommit filetype
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' |