I want to create a ‘quickfix’ list (see :help quickfix) with all files that contain lines with “abc” but not “xyz”. I was hoping I could run the following vim ex command:
:grep -nHr abc * | grep -v xyz
Unfortunately, vim doesn’t like the “pipe” and the command fails. What is the best way to do this from within vim?
For some reason I can’t leave this one alone!
How about use
:!grep ... > filenamefollowed by:cf filename, which will open the output as a quickfix list.