I use Vim from the CLI and use tabs rather than buffers (as I understand the terminology). I may or may not open multiple files using the
-p option, but end up with a few tabs open at once. If I remember to do so, I'll run
:mkview on a tab when I've made changes that matter (usually folding). When I open a file I do
:loadview to get back to what I had. The
au BufWinEnter ?* silent loadview command, if understood, will load the view whenever I open the file, saving my keystrokes. Similarly
au BufWinLeave ?* mkview should save the status when I close the file. However, if I have not manually done
:mkview on a tab with folding changes and exit with
:qa only the folding for the current tab is saved, all others remain the way they were at the last manual
The only clue to the issue, and not a solution, is in the docs on
h: BufWinLeave which has:
When exiting and v:dying is 2 or more this event is not triggered.
It is possible that using sessions might help, except that I seldom have the same set of files open that I will want to open the next time.
So, how can I get all open tabs to save their state when I do a full exit?