I try to use vim’s internal grep with '**' wildcard as in the following command:
grep "test" **\*.txt
vim gives the following error:
FINDSTR: Cannot open **\*.txt
When I remove the '**' wildcard, the command works properly:
grep "test" *.txt
I changed the backslashes to forward slashes, but it didn’t help neither:
grep "test" **\*.txt
This gives the above error again.
What might be the reason?
Note: I use GVim 7.2 on Microsoft Windows XP.
Doing a “:grep” in Vim under XP does not use “grep.exe”
by default. By default “FINDSTR” is used which is part
of the Windows installation. “FINDSTR” is not compatible
to grep. Due to this you get the error message
See “:help grepprg”.
If you want to use a Windows port of grep you have to install
it since grep is neither part of Windows nor of the Vim
installation.
But since 7.0 Vim has an internal grep called vimgrep.
See “:help vimgrep” for details.
You have to set ‘grepprg’ accordingly so that either
grep or vimgrep is used (instead of the default FINDSTR).