A combination of vim and bash that I find useful
pygrep is beautiful
1 file changed, +12 -0
+12-0ghost.sh
| @@ -2,6 +2,7 @@ touch ~/.ghost/secret.sh | ||
| 2 | 2 | source ~/.ghost/secret.sh |
| 3 | 3 | git config --global core.autocrlf input |
| 4 | 4 | if uname -a | grep -q MINGW;then |
| 5 | + export thisos='windows' | |
| 5 | 6 | alias python3=python |
| 6 | 7 | alias Python=python |
| 7 | 8 | else |
| @@ -80,3 +81,14 @@ function redis { | ||
| 80 | 81 | function redis-cli { |
| 81 | 82 | docker exec -it redis redis-cli $@ |
| 82 | 83 | } |
| 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 | +} |