Don't remember cursor position for commit messages

It's not very useful to be dropped into the middle of your diff when
opening a new commit. This change prevents cursor position from being
restored for the `gitcommit` filetype.
This commit is contained in:
Derek Prior 2013-04-27 10:56:18 -04:00
parent deb7ee5948
commit 5fb405217a

6
vimrc
View file

@ -30,10 +30,10 @@ augroup vimrcEx
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Don't do it for commit messages, when the position is invalid, or when
" inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ if &ft != 'gitcommit' && line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END