Save this as ftplugin/perl.vim below a directory in your Vim runtimepath (type :set runtimepath to find it). This will allow you to search through included modules, use tags easily, and use the define-searching capability ( [d etc) to find subroutine definitions.

I posted this snippet in a message some time earlier, then found that I had to use Super Search to find it. Anyway, I figured I'd put it here.

" Vim filetype plugin file " Language: Perl " Maintainer: Ned Konz <ned@bike-nomad.com> " Last change: $Date: 2001/06/20 20:23:37 $ " $Revision: 1.6 $ " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif " Set this once, globally. if !exists("perlpath") let perlpath = system('perl -e "print join(\",\",@INC)"') endif " Don't load another plugin for this buffer let b:did_ftplugin = 1 " Set 'formatoptions' to break comment lines but not other lines, " and insert the comment leader when hitting <CR> or using "o". setlocal fo-=t fo+=croql setlocal include=\\<\\(use\\\|require\\)\\> setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$',' +.pm','') setlocal isfname=A-Z,a-z,:,48-57,_ setlocal keywordprg=perldoc setlocal iskeyword=48-57,_,A-Z,a-z,: setlocal isident=48-57,_,A-Z,a-z setlocal define=^\\s*sub setlocal comments=:# let &l:path=perlpath setlocal makeprg=perl\ -Mstrict\ -wc\ % setlocal errorformat+=%m\ at\ %f\ line\ %l. setlocal grepprg=rgrep\ -n\ -R\ '*.p[ml]'\ $* map <buffer> <C-]> :exec ":tag /".expand("<cword>")

In reply to VIM 6.0 filetype plugin for Perl by bikeNomad

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.