You can create a session with
:mksession [sessionName.vim]
But if you later modify that session (ie. add/remove buffers) you have to manually save the session again, but doing so will generate the following error
E189: "Session.vim" exists (add ! to override)
which is an error you generally get with Save As not Save. So I have two questions:
- Is there no
Savefunctionality here? - Is there a way to
autosaveall changes to the session file?
Note: I am aware that I can issue mksession! sessionName.vim to overwrite an existing session file.
mksession!is really the only way to go.vimrc:au VimLeavePre * if v:this_session != '' | exec "mks! " . v:this_session | endifOf course there are plugins that help you save/load and automate saving sessions. Try searching http://vim.org for session.