If it's not already clear, it helps to be a touch typist to appreciate vi.

Something I've discovered recently (after wishing for a long time and not being quite motivated enough to look for such) is vimgrep. I work on a Windows machine and haven't installed some sort of grep....

One reason I like it stems from the fact that my program is a collection of about 20 Perl files and I have sprinkled error codes throughout. (The wisdom of which will be the point of some other node.) Well when one of those errors lands in my log file, and it's not obvious to me exactly which of all my files generated the message with that code, I can simply do:

:vimgrep abc123 *.pl

and Vim searches all the .pl files and goes to the first instance of that string. (There are other ways of delimiting the search string.)

If I want to see a split screen of the various hits for the search, I can do :cope and a listing pops up at the bottom that I can traverse with my navigation keys (e.g. h, j, k, l) and when my cursor is on the line that matches a line in a file I want to go to, I just press Enter. Ah, much better than the previous way, to which I will not admit.... (You can close out the split screen by clicking in that section and doing :q.)


In reply to Re: Vim and You by ff
in thread Vim and You by nefigah

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.