vim-stay adds automated view session creation and restoration whenever editing a buffer, across Vim sessions and window life cycles. It also alleviates Vim's tendency to lose view state when cycling through buffers (via argdo
, bufdo
et al.). It is smart about which buffers should be persisted and which should not, making the procedure painless and invisible.
If you have wished Vim would be smarter about keeping your editing state, vim-stay is for you.
- The old way: download and source the vimball from the releases page, then run
:helptags {dir}
on your runtimepath/doc directory. Or, - The plug-in manager way: using a git-based plug-in manager (Pathogen, Vundle, NeoBundle etc.), simply add
kopischke/vim-stay
to the list of plug-ins, source that and issue your manager's install command.
Recommended: set viewoptions=cursor,folds,slash,unix
. Edit as usual. See the documentation for more.
Keeping editing session state should be a given in an editor; unluckily, Vim's solution for this, view sessions, are not easily automated without encountering painful bumps. As the one plug-in I found that aims to fix this, Zhou Yi Chao’s restore_view.vim, limits itself to Vim editing sessions, doesn’t play well with other position setting plug-ins like my own vim-fetch and as I wasn’t very happy with its heuristics, I wrote my own.
vim-stay is licensed under the terms of the MIT license according to the accompanying license file.