":global" results in quickfix window

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

":global" results in quickfix window

Jean-Rene David-2
I often use :g/foo/# to search for a pattern when I know
it occurs many times in a file and I want to avoid
using / followed by multiple "n"'s to find a
specific match.

Tip 1063
(http://www.vim.org/tips/tip.php?tip_id=1063)
shows how to save the output of :g to a file.
Has anyone had this working by sending the output
to the quickfix window?

I mean if it's just a matter of finding the right
'errorformat' I'll figure it out. I just want to
know if someone's got it up and running already
before I spend the time.

--
JR
Reply | Threaded
Open this post in threaded view
|

Re: ":global" results in quickfix window

Marian Csontos
On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <[hidden email]>  
wrote:

> I often use :g/foo/# to search for a pattern when I know
> it occurs many times in a file and I want to avoid
> using / followed by multiple "n"'s to find a
> specific match.
>
> Tip 1063
> (http://www.vim.org/tips/tip.php?tip_id=1063)
> shows how to save the output of :g to a file.
> Has anyone had this working by sending the output
> to the quickfix window?
>
> I mean if it's just a matter of finding the right
> 'errorformat' I'll figure it out. I just want to
> know if someone's got it up and running already
> before I spend the time.
>

Hi, with vim7 it so easy - simply use :vimgrep

Regards,

-- Marian



________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: ":global" results in quickfix window

Yegappan Lakshmanan
Hi,

On 2/1/06, Marian Csontos <[hidden email]> wrote:

> On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <[hidden email]>
> wrote:
>
> > I often use :g/foo/# to search for a pattern when I know
> > it occurs many times in a file and I want to avoid
> > using / followed by multiple "n"'s to find a
> > specific match.
> >
> > Tip 1063
> > (http://www.vim.org/tips/tip.php?tip_id=1063)
> > shows how to save the output of :g to a file.
> > Has anyone had this working by sending the output
> > to the quickfix window?
> >
> > I mean if it's just a matter of finding the right
> > 'errorformat' I'll figure it out. I just want to
> > know if someone's got it up and running already
> > before I spend the time.
> >
>
> Hi, with vim7 it so easy - simply use :vimgrep
>

In Vim7, you can also use the new ":caddexpr" command
to add the results to the quickfix window:

g/<pattern>/caddexpr expand("%") . ":" . line(".") .  ":" . getline(".")

- Yegappan
Reply | Threaded
Open this post in threaded view
|

Re: ":global" results in quickfix window

Hari Krishna Dara
In reply to this post by Jean-Rene David-2

On Wed, 1 Feb 2006 at 3:16pm, Marian Csontos wrote:

> On Wed, 01 Feb 2006 14:39:47 +0100, Jean-Rene David <[hidden email]>
> wrote:
>
> > I often use :g/foo/# to search for a pattern when I know
> > it occurs many times in a file and I want to avoid
> > using / followed by multiple "n"'s to find a
> > specific match.
> >
> > Tip 1063
> > (http://www.vim.org/tips/tip.php?tip_id=1063)
> > shows how to save the output of :g to a file.
> > Has anyone had this working by sending the output
> > to the quickfix window?
> >
> > I mean if it's just a matter of finding the right
> > 'errorformat' I'll figure it out. I just want to
> > know if someone's got it up and running already
> > before I spend the time.
> >
>
> Hi, with vim7 it so easy - simply use :vimgrep
>
> Regards,
>
> -- Marian

To the OP, if Vim7 is not an option, my greputils plugin will help you.
Are you aware of the vim.org scripts section? If you do a search for
grep you will find this and other plugins.

--
HTH,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com