created 2005 · complexity basic · author manalive · version 6.0
You can use
:mkview to save folds and such when you close a file - but you have to use
:loadview next time you use the file.
With two lines in your vimrc, you can make that automatic.
I got all excited to post this, then found a tip that already mentioned it, back in 2001: VimTip122 "Skip blank lines when folding text." As he put it:
And as an added bonus, for those new to text folding, add this to your .vimrc file too:autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview
That way whatever folds you set won't get lost when you quit. I had that happen after spending 15 minutes folding up a 3000+ line file.