Greg Matheson wrote:
On Tue, 05 Dec 2006, A.J.Mechelynck wrote:
KLEIN Stéphane wrote:
Hi,
This is actually OT for Vim, since grep is an external program; but you can
use
grep -r --exclude=PATTERN
to skip any directory matching the pattern (at least with GNU grep).
Apparently this doesn't work for GNU grep. It only excludes
matches on file basenames, I am told.
Correct me if I am wrong.
In Vim you would use (IIUC)
:set grepprg=grep\ -r\ --exclude=*.svn
:grep \<word\> ~/dir/subdir/*
Hmm... In "man grep" I read
-R, -r, --recursive
Read all files under each directory, recursively; this is equiv‐
alent to the -d recurse option.
--include=PATTERN
Recurse in directories only searching file matching PATTERN.
--exclude=PATTERN
Recurse in directories skip file matching PATTERN.
so maybe you're right. I haven't tested it.
Best regards,
Tony.