问题
I'm using vim 7.2 in iterm2 (Snow Leopard). I'd like to save/restore buffers between vim sessions automatically, and added this line to my vimrc:
set viminfo+=%
Now, I open a couple of files and quit vim. I expect them to be there, but I get the home screen. This is the output of :set viminfo
viminfo='100,<50,s10,h,%
Am I missing any step here?
回答1:
What you need is reading :help mksession.
And the Vim Wiki(a) has some tips to use it automatically.
来源:https://stackoverflow.com/questions/9055535/saving-restoring-buffers-not-working-in-vim