Jorge Almeida wrote:
On Wed, 6 Sep 2006, Yakov Lerner wrote:

Are you on Windows ?
No way!
On unix/linux, it's dubious you would lose
viminfo contents (that' where cursor positions come from)
when upgrading vim. I upgrade vim often, and I never lose
cursor positions (linux).
Well, I did more than once, but I can't garantee the upgrading had
something to do with it. Maybe too much time passed before revisiting
the same file...

The viminfo file holds mark positions for a finite number of files. How many can be set via the 'viminfo' option (q.v.). If the file is pushed too far away in history, you lose marks & cursor position, and the next time you edit it the cursor is at the top of the file.

Find out where is your viminfo file stored, and use
n flag of 'viminfo' option (:help 'viminfo' and scroll down to flag n)
to keep this file in the location which is not overwritten
(like c:\viminfo )

Didn't know about that file. It's in ~/.viminfo.
I think a session file would be more appropriate. But the manual is not
clear to me: If I start vim as "vim -S vimbook.vim", will the file
vimbook.vim be automaticaly updated when exiting vim?
Thanks.

Jorge

A viminfo in your home directory won't be overwritten by an upgrade.

You can set your viminfo anywhere, see
        :help 'viminfo'
        :help :rviminfo
        :help :wviminfo

After "vim -S vimbook.vim" I don't think it will be updated at exit, UNLESS you add the following to your vimrc:

        :au VimLeave *
                \ if exists("v:this_session")
                \ && v:this_session != ""
                \ |     exe "mksession" v:this_session
                \ | endif

(you can write it all on one line without \ line continuators but this way our mailers won't try to "beautify" it).


Best regards,
Tony.

Reply via email to