Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I autofold POD in Perl with vim?

Tags:

vim

perl

folding

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?

like image 304
Ovid Avatar asked Feb 19 '09 14:02

Ovid


1 Answers

You forgot

:set foldmethod=syntax
:setf perl
:syntax on
:set foldenable
:syn region POD start=/^=head[123]/ end=/^=cut/ fold
like image 91
Andrew Barnett Avatar answered Oct 06 '22 15:10

Andrew Barnett