Search code examples
perlvimfolding

How can I autofold POD in Perl with vim?


I'm trying to edit files with vim and get the POD automatically folded (just the POD, not the Perl). I can't get it to work. I can get folding itself to work because I can manually highlight the lines and type zF and it folds properly.

Can anyone shed light on this?


Solution

  • You forgot

    :set foldmethod=syntax
    :setf perl
    :syntax on
    :set foldenable
    :syn region POD start=/^=head[123]/ end=/^=cut/ fold