I just recently learned how to use folds and I find it very useful. I have added a rule to automatically save the view with my folds when I'm editing the markdown files with the rule:
augroup QuickNotes
au BufWinLeave *.md mkview
au BufWinEnter *.md silent loadview
augroup END
But when I have saved it and copied a file somewhere the folds were there no more.
My question is:
Is it possible to save folds (the view) into the text file I'm editting?
If not then maybe I can write a rule that will save the view into something like .%.view (dot filename dot view) ?
Extra curious:
If I save the views to the default location- where is that?
:mkviewand:loadviewwill work with the default location. If you want to make them work with a specific filename you must give it to them as argument. – romainl Sep 09 '16 at 08:14loadviewonly takes one argument which is[nr]. Help says that : Load the view for the current file. When [nr] is omitted, the view stored with ":mkview" is loaded. When [nr] is specified, the view stored with ":mkview [nr]" is loaded. – lewiatan Sep 09 '16 at 08:26:source <path/to/view>; the saved view is nothing but an auto-generated Vim script. – Ingo Karkat Sep 09 '16 at 08:40