Created
May 9, 2015 21:50
-
-
Save scottstanfield/84694d1fdf698d6d1c13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Put this in your .vimrc | |
" Jump to the last position of the cursor except for git commits | |
function! PositionCursorFromViminfo() | |
if !(bufname("%") =~ '\(COMMIT_EDITMSG\)') && line("'\"") > 1 && line("'\"") <= line("$") | |
exe "normal! g`\"" | |
endif | |
endfunction | |
au BufReadPost * call PositionCursorFromViminfo() | |
" Jump to the last position of the cursor | |
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just extracted this from my .vimrc for @icecreammatt. There might be more dependencies.