irongit

A combination of vim and bash that I find useful

pygrep is beautiful

huncholanehuncholaneauthored
parent 9f23a59commit fff529c9ca81688a44e55a012b5f71a258e5c5afBrowse files

1 file changed, +12 -0

+12-0ghost.sh
@@ -2,6 +2,7 @@ touch ~/.ghost/secret.sh
22 source ~/.ghost/secret.sh
33 git config --global core.autocrlf input
44 if uname -a | grep -q MINGW;then
5+ export thisos='windows'
56 alias python3=python
67 alias Python=python
78 else
@@ -80,3 +81,14 @@ function redis {
8081 function redis-cli {
8182 docker exec -it redis redis-cli $@
8283 }
84+function pygrep {
85+ local start=`pwd`
86+ local pylocation=`which python`
87+ local pydir=`dirname $pylocation`
88+ local packagedir=$pydir/Lib/site-packages
89+ cd $packagedir
90+ local package=$1
91+ shift
92+ grep -rni "$@" $package
93+ cd $start
94+}