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:
parent
deb7ee5948
commit
5fb405217a
1 changed files with 3 additions and 3 deletions
6
vimrc
6
vimrc
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue