Wednesday, February 13, 2008

Last File Location

Some Linux distributions set this up by default and some don't. I like Vim to open a file I'm working on to the last location I was in before exiting. This can be accomplished by adding the following to your .vimrc.

au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif

No comments: