Last active
August 2, 2019 13:30
-
-
Save patrickbucher/dbf49ff8415ffe714305cd84486987ab to your computer and use it in GitHub Desktop.
open resulting files from ripgrep search tabbed in vim
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
# sample usage: | |
# $ cd /home/paedu/c | |
# $ virgp stdio | |
function virgp { | |
files="$(rg -l $1 | tr '\n' ' ')" | |
if [ -z "$files" ] | |
then | |
echo "pattern $1 did not match any files" | |
else | |
#echo "vim -p ${files}" | |
vim -p ${files} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment