When editing Python files at work I have to include 20+ lines of boilerplate legalese at the start of the file. "start of the file" is not that strict: I'm allowed to include the Python docstring, and future imports before the boilerplate. But the boilerplate itself is very strict, I have to include it verbatim from a company template. Specifically: I am not allowed to indent it.
For Python I use
:set foldmethod=indent
but I would like to be able to fold away that boilerplate as well.
Is it possible to tweak the indent foldmethod to fold lines starting/ending with '#' as well? Or will I need to change to foldmethod=expr
and write my own folding function?
Copyright © ...; see below for full copyright
, and then put the license at the bottom of the file (like this). I have no idea if this is an option for your PHB, but you could try suggesting it.. – Martin Tournoij Feb 27 '15 at 13:21autocmd
onBufReadPost
andBufWritePre
... I don't know what your file looks like exactly, so I can't give you a ready-made function – Martin Tournoij Feb 27 '15 at 13:24