Skip to content

Instantly share code, notes, and snippets.

@abuseofnotation
Last active May 8, 2019 10:01
Show Gist options
  • Save abuseofnotation/cb28d751df3c08256c4403e2c2bf6f23 to your computer and use it in GitHub Desktop.
Save abuseofnotation/cb28d751df3c08256c4403e2c2bf6f23 to your computer and use it in GitHub Desktop.
Custom command which opens all files matching a given pattern in vim
#!/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