Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Vim and You

by ff (Hermit)
on Mar 27, 2008 at 04:46 UTC ( [id://676631]=note: print w/replies, xml ) Need Help??


in reply to Vim and You

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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://676631]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2025-11-15 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (72 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.