Tuesday, January 5, 2010

[Level 1] Back to the last position in Vim

Everytime when we left Vim, and we have to use the arrow down from the first line,
is that possible to back to the last position when we re-open it?
You can add the configuration below in your .vimrc!

au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

Wish this helps.

Stanley Huang