:vimgrep looks like a really useful thing.
Here’s how to use it:
:vim[grep][!] /{pattern}/[g][j] {file} ...
:help says that you can essentially glob {file} to name, say, *.c for the current directory. I may have started Vim with a list of files that is complicated enough that I don’t want to manually type it in for {file}, and besides Vim already knows what those files are.
What I would like to do is vimgrep over any of:
:args:files:buffers
What variable(s) would I use in place of {file} to name, respectively, any of those lists in a vimgrep command?
Can’t you catch the result in these commands into a register (
:h :redir), and insert it back into:vimgrepcall (with a:exe).Something like:
Notes:
:redir; nothing really complex:argsthat adds square brackets)join(argv(), ' ')in:argscase.