Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It looks like you are trying to re-invent the nice quickfix mode integration for Perl that's built into VIM 6.0. Here's how to get started with it. It's super handy.
  • Quickfix Mode Integration Like other great editors, vim has a built in mechanism to speed up the compile-debug-edit cycle. Here's the least you need to know to get running with this.
    1. Tweak your .vimrc file Add these lines to your .vimrc to get started. The first command tells vim to compile the current buffer when you type ":make", the second command tells vim to recognize the error format that Perl returns.

         set makeprg=$VIMRUNTIME/tools/efm_perl.pl\ -c\ %\ $*
            set errorformat=%f:%l:%m
         

      To make this cycle even faster, also add this line:

         set autowrite
         

      That will cause the file to automatically be saved in some cases, such as when you type ":make".

    2. Set your Perl Path If you are using some of your own modules, you need to give vim a hint about where to find them. There are two straightforward ways to handle this. One is to set the path in one of the environment variables that Perl will look in, such as PERL5LIB. The other method is to simply use vim command ":lcd" to set the Local Current Directory for the perl file you want to compile to be relevant libary path.
    3. Compile your Perl from within vim You are now ready to compile a script from within vim. Simply use ":make" for this. Vim will run "perl -c yourscript.cgi" and process the results. It will show you a list of the resulting errors, if any, and jump to the first error.
    4. Navigate your errors You are now in quickfix mode and have some commands available to quickly address the remaining errors. Here are the essential commands for this: ":cl" lists all the errors for you again, ":ccN" jumps to error number 'N', ":cn" jumps to the next error. You can read the details with ":help quickfix"

-mark


In reply to Re: .vimrc options (quickfix mode integration) by markjugg
in thread .vimrc options to assist with perl coding by Malach

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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others imbibing at the Monastery: (4)
    As of 2025-06-24 14:17 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?
      erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.