Vim: using views automagically
I use Vim Outliner for note-taking. It is an extremely useful tool. However, my files can get long. Vim's folding features are a great way to deal with that: I simply fold up all the irrelevant sections.
What I really wanted was a way to preserve my folds over editing sessions. I found this gem in the vim help documents:
This automatically executes mkview on leaving a buffer and loadview on entering a buffer -- but only for outline (*.otl) files. Ah, the joys of a industrial strength text editor!autocmd BufWinLeave *.otl mkview autocmd BufWinEnter *.otl silent loadview
Technorati tags for this post: Tech vim programming gtd