Last active
May 8, 2019 10:01
-
-
Save abuseofnotation/cb28d751df3c08256c4403e2c2bf6f23 to your computer and use it in GitHub Desktop.
Custom command which opens all files matching a given pattern in vim
This file contains hidden or 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 | |
# uses ripgrep to search for all matches of a given phrase in the current directory and open all | |
# files which contain matches in vim | |
function rv() { | |
vim -p $(rg -l "$1" | sed 'sa\\a/ag') -c "/$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment