Last active
January 25, 2018 14:35
-
-
Save dehlen/f9ab17566a09ed1060291beab83b8aed to your computer and use it in GitHub Desktop.
search for text in directory and open resulting files in sublime text
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
# install the_silver_searcher via brew install the_silver_searcher | |
# install SublimeText from the offical website | |
# add the following to ~./bashrc | |
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl' | |
function sublf() { | |
for i in $(ag -l --hidden "$1"); do subl "$i"; done | |
} | |
# run source ~/.bashrc to reload bashrc | |
# run sublf sometext to search for sometext in the current directory and open all files which contain sometext in Sublime Text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment