Skip to content

Instantly share code, notes, and snippets.

@dtuite
Last active March 31, 2020 15:52
Show Gist options
  • Save dtuite/5210215 to your computer and use it in GitHub Desktop.
Save dtuite/5210215 to your computer and use it in GitHub Desktop.
Pipe grep or ack into vim
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