This is still in development and features are likely to change and stop working
Vim plugin to help manage Vim sessions. You can save sessions using :SessionSave {name}
and restore sessions using :SessionRestore {name}
. Mappings exist for all letters similar to registers. Save a session with <Leader>ss{key}
and restore a session with <Leader>sr{key}
.
There is also a jumplist that saves recent sessions you have used. A new jump is added when you save or restore a session. You can jump backwards with :SessionTravelJumpList
or <Leader>so
.
A session is saved each time you close Vim. These can be restored with :SessionTravelExitHistory {number}
or <Leader>sr{number}
. {number}
is the position in the exit history. Position 1 represents the most recent entry.
<Leader>ssn
save sessionn
.<Leader>srn
restore sessionn
.<Leader>so
jump back in session jumplist. Will restore sessionn
if run in this order.<Leader>sr1
jump back in session exit history. Will restore Vim to when it was last closed.<Leader>sr3
restore Vim to when it was closed three times ago.:SessionSave mySession
save sessionmySession
.:SessionRestore mySession
restore sessionmySession
.
The default behaviour is to include global mappings and options in the session files. Loading an old session will therefore include old mappings and options which might not work correctly anymore. This may or may not be what you want. Add the following line to your .vimrc
to disable this feature.
let &sessionoptions = substitute(&sessionoptions, 'options,', '', '')
The sessions are stored in vim-plugin-folder/vim-sessions/sessions
. To manually restore a session you run :source {path-to-session-file}
in Vim. You can also start Vim with a session from the command line: vim -S {path-to-session-file}
.