Skip to content

Instantly share code, notes, and snippets.

@AWhetter
Created November 21, 2016 21:49
Show Gist options
  • Save AWhetter/af2fa9331e4697d82fe59cb897fc9a62 to your computer and use it in GitHub Desktop.
Save AWhetter/af2fa9331e4697d82fe59cb897fc9a62 to your computer and use it in GitHub Desktop.
A wrapper around grep that recursively searches a file or directory and opens the results in a vim location window
#!/bin/bash
set -e
temp=$(mktemp)
grep -nHr "$@" > "$temp"
vim -c "lgetfile $temp" -c "lw" -c "wincmd o"
rm "$temp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment