That point is covered here:
http://vim.wikia.com/wiki/Find_in_files_within_Vim
John
After you've typed ":vimgrep /", type Ctrl-R Ctrl-W to insert the
word under the cursor. See
:help c_CTRL-R_CTRL-W
Regards,
Gary
I was too lazy to tell you about Ctrl-R Ctrl-W.
If you want to search all *.c files in the current directory,
you would execute the following (put cursor on line, press Y
then type @" or just put it in your vimrc):
:map <F4> :execute "vimgrep /" . expand("<cword>") . "/j *.c"<Bar>cw<CR>
Now put the cursor on any word and press F4.
John
Now put the cursor on any word and press F4.
John
The <Bar> means '|' and it delimits another command.
That command is :cw (:help :cwindow) which displays the results.
The 'j' in '/j' means you do NOT jump to the first hit.
John