3 ms·
I have a similar workflow already that may be of use to vim users. I pipe file lists (from grep etc) into vim (using a '-' to tell vim to read from stdin): g
by TomNomNom 11y ago
I have a similar workflow already that may be of use to vim users. I pipe file lists (from grep etc) into vim (using a '-' to tell vim to read from stdin):
grep -nri searchterm * | vim -
You can then use 'gF' over a file name to open the file in question (and be taken to the right line number if specified in the form somefile.txt:42). You can use '<c-w>gF' to open the file in a new tab, or '<c-w>F' to open the file in a split instead.
As an added bonus you can re-filter the file list from within vim to, for example, remove things from a test directory without having to run the original command again:
:%!grep -v ^test
- jstx 11y agoThis is fantastic. Thanks for sharing.