On Tue, May 6, 2008 at 8:17 PM, Tzafrir Cohen <[EMAIL PROTECTED]> wrote:

> On Tue, May 06, 2008 at 02:58:18PM +0300, Erez D wrote:
> > On Tue, May 6, 2008 at 12:10 PM, Tzafrir Cohen <[EMAIL PROTECTED]>
> > wrote:
> >
> > > On Tue, May 06, 2008 at 11:04:30AM +0300, Erez D wrote:
> > > > hi
> > > >
> > > > i am running gvim under XP, and want to search for a word in a list
> of c
> > > > files,
> > > >
> > > > i could do that by:
> > > > :args *.c
> > > > :argdo /word
> > > >
> > > > but i prefer to get the output similar to the output of make: a list
> of
> > > > lines where i can click and get to the places
> > > >
> > > > i tried combining argdo with vimgrep or grep but wasn't successful.
> > > >
> > > > anyone ?
> > >
> > > :h grep
> > >
> > >  Vim has two ways to find matches for a pattern: Internal and external.
> > >  The advantage of the internal grep is that it works on all systems and
> > >  uses the powerful Vim search patterns.
> > >
> > >  ...
> >
> > you are probably a mathematician,
> > your answer is exact
> > and it does not help in any way ...
>
> :grep is basically what you're looking for. As I don't know what your
> specific setup is, I refered you to its documentation.
>
> Just as ':make' has basically the same syntax as the original command
> (:make targetname), :grep has the same basic syntax as the shell
> command: ':grep pattern files'
>
> --
> Tzafrir Cohen         | [EMAIL PROTECTED] | VIM is
> http://tzafrir.org.il |                    | a Mutt's
> [EMAIL PROTECTED] |                    |  best
> ICQ# 16849754         |                    | friend
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
>

for anyone who is interested, here is an example of searching inside a
project

"first set files in project
args C:\Work\sw\trunk\*.c
"add other files to project
args C:\Work\sw\trunk\*.h
"map ctrl-shift-f to find in files ...
map <C-F> yiw:tabfirst<CR>:argdo vimgrepadd /\<<C-R>"\>/gj
%<CR>:copen<CR>:onl<CR>

"make by ctrl-Shift-B, or by a new compile->make menu
map <C-B> :make<CR>:tabfirst<CR>:copen<CR>:onl<CR>
menu &Compile.&Make <C-B>

cheers,
erez.

Reply via email to