François Ingelrest wrote:
Hello,

I'm also using vim with an Ubuntu Feisty. Here is what I have in my .vimrc:

" Try to restore cursor position when reading a buffer
au BufReadPost * if line("'\"") | exe "normal '\"" | endif

It works quite well.

Yeah, that is almost the same as the code in the vimrc_example.vim. The latter also guards against invalid remembered locations, and doesn't update the jumplist:

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid or when inside an event handler
  " (happens when dropping a file on gvim).
  autocmd BufReadPost *
    \ if line("'\"") > 0 && line("'\"") <= line("$") |
    \   exe "normal! g`\"" |
    \ endif


So here's what /I/ have in my vimrc, and it works quite well:

runtime vimrc_example.vim



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
224. You set up your own Web page. You set up a Web page for each
     of your kids... and your pets.

Reply via email to