Make Vim persist editing state without fuss
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,
bufdoet 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.
:helptags {dir}on your runtimepath/doc directory. Updating the plug-in via
:GetLatestVimScriptsis supported. Or,
zhimsel/vim-stayto the list of plug-ins, source that and issue your manager's install command. Or,
pack/vim-stay/start/directory in your
'packagepath'and clone this repository into it. Run
:helptags {dir}on the
docdirectory of the created repo. Run
:runtime plugin/stay.vimto load vim-stay (or restart Vim).
Recommended:
set viewoptions=cursor,folds,slash,unix(but at the very least do
set viewoptions-=options). 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 available that aimed to fix this, Zhou Yi Chao’s restore_view.vim, limited itself to Vim editing sessions, didn’t play well with other position setting plug-ins like vim-fetch and as there were some issues with its heuristics, vim-stay was born.
vim-stay is licensed under the terms of the MIT license according to the accompanying license file.