tags:

views:

277

answers:

1

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, so I've tried disabling all of my plugins and my .vimrc with this:

vim -u NONE some_perl.pl

I assume that my POD blocks in my project with start with '=head1', '=head2' or '=head3'. They will always end with '=cut'.

Then, in command mode, I type type the following:

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

That's identifying the POD because the POD turns white while the rest of the syntax highlighting remains, but it's not folding the POD.

I've tried the above with various combinations of:

:syn-sync-first

And:

:syn sync fromstart

But no luck.

I know the folding itself works because I can manually highlight the lines and type 'zF' and it folds properly.

Can anyone shed light on this? More importantly, how do I debug this?

+8  A: 

You forgot

:se foldmethod=syntax

Andrew Barnett
It only works if I fail to load my .vimrc. Regrettably, I can't figure out how to debug what's causing the conflict. Still, it's a step closer. Thanks!
Ovid
Comment out half the file. If it works, the problem is in that half.Repeat.
jrockway
@jrockway D'oh! I'll have to do that with my plugins, too. Those are the ones which will be a pain, but yeah, I'll figure out how to get this working :)
Ovid