- " 5.5. How do I configure Vim to open a file at the last edited location?
- " Vim stores the cursor position of the last edited location for each buffer
- " in the '"' register. You can use the following autocmd in your .vimrc or
- " .gvimrc file to open a file at the last edited location:
- au BufReadPost *
- \ if line("'\"") > 0 && line("'\"") <= line("$") |
- \ exe "normal g`\"" |
- \ endif