Created
November 21, 2016 21:49
-
-
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
This file contains 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
#!/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