Created
May 26, 2020 16:51
-
-
Save axelerator/06346d680b6037c97185a160a4bc7650 to your computer and use it in GitHub Desktop.
Open all files found with ripgrep 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
#!/bin/sh | |
MATCHES=`rg -l $@ ` | |
echo "$MATCHES" | |
read -p "Open these files?([Y/n])" -n 1 -r | |
if [[ $REPLY = '' || $REPLY =~ ^[Yy]$ ]] | |
then | |
FILES=`echo $MATCHES | tr "\n" ' '` | |
vim $FILES | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment