How might Ι automatically fold all paragraphs where every line begins with %%
? Would be good for comments in TeX.
Try this setting:
:set foldenable foldmethod=expr foldexpr=getline(v:lnum)=~'^\s*%%'
-
Thanks! it seems, though, that with this setting, it is no longer possible to create folds without this pattern with
:fold
. – Toothrot Oct 17 '15 at 18:43