On 2009-10-26, oversky wrote:
> Is it possible to process grep's result before sending to quickfix?
There are a number of ways to do this.
1. Set 'grepprg' to add a filter after grep as in the examples of
'makeprg' found from
:helpgrep make.*\\|
2. Write a vim function to save the output of grep to a file, then
edit that file before reading it into the quickfix buffer
with a command such as :cf. See
:help :cf
and the commands that follow it in the help file.
3. Write a shell script that executes grep and filters the output.
Set 'grepprg' to the name of that script.
I prefer #3 as it keeps all the details of the filtered grep command
in one place, and because it's easy to execute
:set grepprg=mygrepcmd
without having to use a lot of backslashes.
HTH,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---