So basically I'm looking for a * command that would have an effect
across files. I'm aware of :grep but I couldn't get that to recognize
only keywords, it only does a plain grep.

Well, something 100% untested would be something like

:nnoremap <f8> :grep -r '<c-r><c-w>' *<cr>

I couldn't discern from the help whether the internal grep supported either "-r" or a filename/path of something like "**/*" to recurse subdirectories.

Vim7 supports an internal "vimgrep" which, IIUC, does support the "**/*" notation for recursing directories.

The results of this are accessible with

        :cn

and
        :cN

Tony's message just showed up (blast, he's quick on the draw ;) with much the same ideas and a good, thorough description of how to use the cn/CN/etc family of commands. So the main addition from my suggestion would be the use of ^R^W to insert the text under the cursor rather than the additional step of tromping on your scratch register, and the possibility of using the "grep" abilities (which may have required an external grep?) rather than the "vimgrep" in the event you don't have vim7

Would this be possible with vim 6?

See above notes about :grep vs. :vimgrep regarding vim6 vs. vim7 requirements.

-tim



Reply via email to