I have the below settings in my .vimrc relating to Perl code folding.
When I type za
to toggle folding, it works on any sub { }
by just folding up the sub.
However, if I za
a non-sub block (e.g. if
* or for
or while
) it folds up the entire rest of the file, not just the block.
I just want to fold up the block. How might I achieve this?
" Perl auto-folding
set foldmethod=syntax
set foldlevelstart=3
let perl_fold = 1
let perl_fold_blocks = 1
* if
s are officially statements rather than blocks in Perl, but I would still like to fold them.
/usr/share/vim/vim74/syntax/perl.vim
line 426 ... Being a Perl hacker, you might have more luck deciphering the regexps that control this :-)za
toogles folds for the current line. I assume that the lines you are toggling on are not in any folds except for one big fold that includes the whole file. You can tryset foldcolumn=12
to better visualize how folds are nested.