How can I export vim folds from a file, so that I can transfer it to a different machine?
For example say I create the folds in a file and save it on a local machine – where does the “folding” metadata go? Can I just copy it to another machine, or must I manually recreate the folds again?
EDIT: Hm, I’ve noticed this might be a duplicate question, but still there is not answer as to how to save the fold information WITHOUT modifying the source file.
Thanks
Save your session with the
:mksessioncommand, and restore it withvim -S Session.vim. The session file will restore almost everything, including folds (though changes to the file will mess it up).That works if you must use manual folds, but it’s really a lot easier to use one of the automatic fold methods — investigate
indent,syntax, andexpr, and look for syntax files that fully support folding.