I have been searching a solution which puts the fold marks and codes to an external hidden file. This way you could have permanent folds without extra fold signs.
How can you control folds by an external file in Vim?
I have been searching a solution which puts the fold marks and codes to an external hidden file. This way you could have permanent folds without extra fold signs.
How can you control folds by an external file in Vim?
That's a very general question. What is "an external file" in vim, really ? Vim is, after all, a collection of "external" files. So if I define my folding preferences in my vimfiles, is that "an external file" solution ?
You could link, for example, define regex mechanisms of folding and source them from an external file.
But I think, what you ment is, "can I define an external file, so I can have by project custom folding, so that everyone who uses vim after I give them my files, will have the same folding" ? Yes, I guess you could do that by extrapolating from the method above.
But remember, vim has several methods of folding:
... in the end, it will all come down to those few settings in your vimrc.
My advice: DO NOT CHANGE vim's indenting, syntax, etc. files. Normally, you will not even need to change those (unless you're using a language vim has no support for, which I doubt). So, define your settings and preferences in your vimrc and vimfiles directory, and just give your coleagues preferences which they need (usually just those from vimrc) to have the same folding behaviour.
Use manual
method of making folds. This is not the same as marker
as implied above. Use :mkview
to save folds and :loadview
to reload them.
Vim can be made to atuomatically remember folds in a file by putting these two lines in ~/.vimrc
au BufWinLeave ?* mkview au BufWinEnter ?* silent loadview