Created
July 2, 2015 19:56
-
-
Save francoiscabrol/f7495c45caf0196b8b3c to your computer and use it in GitHub Desktop.
interactive grep with percol and 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
// Use grepi as you would use grep and it will open the matching lines in percol | |
// then press enter to open it in vim at the good line | |
// ex: grepi -r [pattern] [folder] | |
// You need percol to be installed | |
grepi() { | |
vim $((grep -n $@ | sed 's/:/ /g' | percol | awk '{print "+"$2 " " $1}') || '-c quit') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment