Last active
March 31, 2020 15:52
-
-
Save dtuite/5210215 to your computer and use it in GitHub Desktop.
Pipe grep or ack into vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim $(grep -rl something ./app) | |
# The -l (for "Lima") flag ensures that grep returns only the matching file names. | |
# Page through results in Vim with `:n`. | |
vim $(ack -l something ./app | xargs) | |
# The -l (for "Lima") flag does the same thing as for grep. | |
# We need `xargs` to flatten the list of filenames. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment