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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.