~gpanders/dotfiles

ref: 12291d3163062a0a3c879f53a0b0d02541376ca4 dotfiles/vim/.vim/after/ftplugin/gitcommit.vim -rw-r--r-- 380 bytes
12291d31Greg Anders [vim] Make git commit buffers in vim always start at line 1 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if &filetype !=# 'gitcommit'
  finish
endif

" enable spell check
setlocal spell
setlocal textwidth=72

" warning if first line too long
match ErrorMsg /\%1l.\%>51v/

augroup gitcommit_ftplugin
  autocmd! * <buffer>
  autocmd BufWinEnter <buffer> normal gg0
augroup END

let b:undo_ftplugin .= '|setl tw< spell<'
let b:undo_ftplugin .= '|exe "au! gitcommit_ftplugin * <buffer>"'