obsession.vim: continuously updated session files
Vim features a :mksession command to write a file containing the current
state of Vim: window positions, open folds, stuff like that. For most of my
existence, I found the interface way too awkward and manual to be useful, but
I’ve recently discovered that the only thing standing between me and simple,
no-hassle Vim sessions is a few tweaks:
:mksession immediately before exit.:mksession whenever the layout changes (in particular, onBufEnter), so that even if Vim exits abnormally, I’m good to go.Session.vim inside of it.Use :Obsess (with optional file/directory name) to start recording to a
session file and :Obsess! to stop and throw it away. That’s it. Load a
session in the usual manner: vim -S, or :source it.
There’s also an indicator you can put in 'statusline', 'tabline', or
'titlestring'. See :help obsession-status.
If you don’t have a preferred installation method, I recommend
installing pathogen.vim, and
then simply copy and paste:
cd ~/.vim/bundle
git clone https://github.com/tpope/vim-obsession.git
vim -u NONE -c "helptags vim-obsession/doc" -c q
Like obsession.vim? Follow the repository on
GitHub and vote for it on
vim.org. And if
you’re feeling especially charitable, follow tpope on
Twitter and
GitHub.
Copyright © Tim Pope. Distributed under the same terms as Vim itself.
See :help license.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.