blob: 1a4c1b1b26aa44ee3ebebd2f5388fa50277c092b (
plain) (
tree)
|
|
" Make angle brackets behave like mail quotes
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 .= '|execute ''autocmd! gitcommit'''
\ . '|augroup! gitcommit'
\ . '|setlocal colorcolumn<'
endif
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_gitcommit_maps')
finish
endif
" Quote operator
nnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
\ . '|nunmap <buffer> <LocalLeader>qq'
\ . '|xunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
nnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
\ . '|nunmap <buffer> <LocalLeader>QQ'
\ . '|xunmap <buffer> <LocalLeader>Q'
|