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
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?