Don't jump to a position within git commits in vim.

This commit is contained in:
David Tomaschik
2020-10-09 16:31:43 -07:00
parent 7e249843a6
commit d117ee6b2e

View File

@@ -33,9 +33,13 @@ set ruler
set viminfo='10,\"100,:20,%,n~/.viminfo set viminfo='10,\"100,:20,%,n~/.viminfo
" Jump back when editing a file " Jump back when editing a file
function! ResCur() function! ResCur()
" Don't jump in git commits since they're generated.
if &ft == 'gitcommit'
return
endif
if line("'\"") <= line("$") if line("'\"") <= line("$")
normal! g`" normal! g`"
return 1 return
endif endif
endfunction endfunction
augroup resCur augroup resCur