Skip to content

Instantly share code, notes, and snippets.

@patrickbucher
Last active August 2, 2019 13:30
Show Gist options
  • Save patrickbucher/dbf49ff8415ffe714305cd84486987ab to your computer and use it in GitHub Desktop.
Save patrickbucher/dbf49ff8415ffe714305cd84486987ab to your computer and use it in GitHub Desktop.
open resulting files from ripgrep search tabbed in vim
# 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