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:
Save
functionality here?autosave
all changes to the session file?Note: I am aware that I can issue mksession! sessionName.vim
to overwrite an existing session file.
To Save a Session ( :mksession , :mks )vim file on the directory where the current Vim execution was started. Using exclamation mark, :mks! the command overwrites Session. vim file if it exists in the directory. You can specify a custom file name to save the session :mks!
You can save a session using the subroutine call syntax as follows: Vim::save_session():
mksession!
is really the only way to go.vimrc
:au VimLeavePre * if v:this_session != '' | exec "mks! " . v:this_session | endif
Of course there are plugins that help you save/load and automate saving sessions. Try searching http://vim.org for session.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With