:Obsessionwith no argument creates a
Session.vimfile in the current directory and begins session tracking using that file.
:Obsessionwhile a session is already being tracked pauses session tracking and
:Obsessionwhile paused unpauses.
:Obsession <directory_or_filename>begins tracking a session with the given filename as the session file, or a
Session.vimin the given directory. Will create the session file if it doesn't exist.
Passing a directory doesn't seem to work -- it produced an error from Vim.
:Obsession!stops recording the current session and deletes the session file.
To load a previously created session you do
vim -S <path_to_session_file>or
:source <path_to_session_file>as usual, rather than using the
:Obsessioncommand. You only use
:Obsessionto create a new session or to delete a session.
If the session file is one created by Obsession, then sourcing it will automatically turn on Obsession's automatic session updating.
Automatically updates the session file before exiting Vim, and also whenever the layout changes (in case Vim crashes)
If you try to make a new session on top of an existing session it just lets you do it, instead of complaining
Has an indicator for your status line, tab line or title string
Airline has a builtin extension for Obsession. Add
let g:airline#extensions#obsession#enabled = 1to your vimrc to enable it. It just seems to put a
$in the status line when Obsession is tracking a session, doesn't display the name of the session.
If you want the size of your GVim window to also be recorded as part of your session add
set sessionoptions+=resizeto your gvimrc.