diff --git a/vimrc b/vimrc index 678a157..37badd4 100644 --- a/vimrc +++ b/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