On 2006-09-07, Daniel Nogradi <[EMAIL PROTECTED]> wrote:
I'll address a couple of issues that haven't been answered yet.
> I'm sure it has been brought up a couple of times but still I couldn't
> find an answer to searching through multiple files in a convenient
> way. What I would like vim to do is:
>
> 1. search only for keywords like the * command
> 3. highlight matches like the * command
The * doesn't search for only keywords, it searches for whole words.
If you like the results you get from using * though, you can use it
with :vimgrep by first typing * on the word you want to search for,
then executing this:
:vimgrep /^R// **/*
where the ^R/ (that is Ctrl-R followed by a slash) inserts the
contents of the search register. This will include the \< and \>
that vim uses to delimit words in patterns and will also highlight
the matches found by :vimgrep.
You could also write a mapping to combine those steps into one.
> Would this be possible with vim 6?
Not using :vimgrep, but you can use :grep in much the same way.
:grep -R '^R/' .
Not all greps understand the \< \> notation. If you have one that
doesn't, you can use the g* command instead of * and then this:
:grep -R -w '^R/' .
HTH,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA