Pages

Wednesday, August 27, 2008

Vim hints: last file location

Using vim and want to re-enter the file at the same location you left it? Add this to your .vimrc file:

" jump to last position before save.
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif

Vim version is 7.1.138.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.