Reputation:
I have a question about code folding in Vim. Let's say I open a file and fold some code, then I save it and quit. Later I open the same file, and my folds are gone. Any idea what's going on?
Upvotes: 1
Views: 89
Reputation: 1426
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.
Further, you can automate this with .vimrc file. Add following to your vimrc.
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
Upvotes: 5