tags:

views:

702

answers:

2

Hi, does any know syntax of Vimgrep to search in multiple file, i am trying to use this command to search into current directory.

map <F3> :execute "vimgrep /" . expand("<cword>") . "/j **/*.c* *.txt" <Bar> cw<CR>

while using this command it search only for *.c*.

Any Idea about searching into multiple file type?

+1  A: 

in this directory

:vimgrep "search subject" *.c
:vimgrep blah *.[ch]
:vimgrep blah *.c* *.h

in this or any descendant directory

:vimgrep "search subject" ./**/*.c
Adrian Panasiuk
It's worth noting that you don't need the ./ for it to work recursively in the current dir.
latortuga
+2  A: 

To search for "text" in all *.txt & *.php files recursively from current directory.

:vimgrep "text" **/*.txt **/*.php
Naga Kiran
Thanks it work like charm.