The new version of VIM (6.0) supports syntax folding. Nick Hibma has written a syntax highlighter for Perl that enables folding on packages and subroutines (but not on any inner blocks); it's at http://www.etla.net/~n_hibma/vim/. It can also do syntax highlighting of pod text at the same time as the Perl.

As far as xrefs, there are a couple of tags generators for Perl; the "exuberant ctags" that comes with VIM will attempt to do Perl subroutine tagging, but there are a couple of tags generators that will also do more. Michael Schaap <mscha@dogbert.demon.nl> has written one that comes with Vim, as I remember, and I have one here that uses the debugger.

For prettyprinting existing code, you're on your own. Vim does do a good job (with 6.0ag) of indenting Perl code as you type it. You could probably make a Vim macro that would re-type the Perl code and thereby use the indenting features.

Vim also supports running Perl internally (if it's compiled that way); this can add some functionality.

Oh yes, for highlighting for HTML, Vim will also output a colorful HTML version of your code like this:

use strict;
package AnySerialPort;
use vars '@ISA';

BEGIN {
    my %portMap;
    my $oldNew;
    my $onWindows = 0;

    if ($^O eq 'MSWin32')   # running on Win32
    {
        $onWindows = 1;
        eval "use Win32::SerialPort";

update: added bit about HTML highlighting.


In reply to Re: Perl syntax hilit and folding... by bikeNomad
in thread Perl syntax hilit and folding... by PetaMem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.