You are not logged in.

#1 2006-08-21 13:43:11

arooaroo
Member
From: London, UK
Registered: 2005-01-13
Posts: 1,268
Website

gvim and grep

Hi,

I need some help from the Vim boffins. Ok, given that vim 7 has its new shiny grep engine built in, I was hoping to take advantage of it. However, I can't seem to get it to work as I want it to and wondered if any one has had much experience.

Quite often, when I use grep, I use it to return only lines of interest from a large input file. Therefore, what I would like is given a large text file, then typing some magical vim commands, I'm left with filtered output - i.e. only the lines that contain something of interest to me (ones that matched my regex).

I'd love to be able to do this interactively, within the buffer itself.

At the moment all I've managed to do is to get the grep functionality to act identically the /regex/ command in that it simply highlights the matches and doesn't omit lines with no match.

I hope this makes sense. TIA

Offline

#2 2006-08-23 22:53:19

lang2
Member
Registered: 2006-02-10
Posts: 386

Re: gvim and grep

How about this:

:g/regepx/p > tmpfile
:splite tmpfile

Offline

#3 2006-08-24 01:58:05

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: gvim and grep

Hopefully someone will come through with this...I'd be interested as well.  I hadn't heard about the built-in grep functionality with Vim 7 until your post.

Offline

Board footer

Powered by FluxBB