tags:

views:

295

answers:

2

Depending on my task in Vim I have several tabs open. How can I save different sessions for later use? Thanks!!

+6  A: 

Hi there,

You want something like

:mksession ~/mysession.vim

Then later you can just source that vim file and you'll have your old session back.

Benj
Ooo, and I almost forgot you can load it back by typing:gvim -S ~/mysession.vim
Benj
Thanks @Benj. I'm new in vim. How can I 'source' in the command line?
Jogusa
Hi Jogusa,That's pretty much what the above comment was about. vim -S
Benj
Ooops! Sorry Benj, I meant command mode. I have already found it: ``:source ~/mysession.vim´´.
Jogusa
+1  A: 

You might want to set these session options in your vimrc. Especially options is annoying when you've changed your vimrc after you've saved the session.

set ssop-=options " do not store global and local values in a session set ssop-=folds " do not store folds

Jan Christoph
Great! I had exactly this problem yesterday. Thanks a lot!
Jogusa