A combination of vim and bash that I find useful
added some django stuff
2 files changed, +29 -3
+2-0.bashrc
| @@ -0,0 +1,2 @@ | ||
| 1 | +source ~/.ghost/ghost.sh | |
| 2 | +source ~/.ghost/ghost.sh |
+27-3ghost.sh
| @@ -1,5 +1,11 @@ | ||
| 1 | 1 | git config --global core.autocrlf input |
| 2 | -alias python=python3 | |
| 2 | +if uname -a | grep -q MINGW;then | |
| 3 | + alias python3=python | |
| 4 | + alias Python=python | |
| 5 | +else | |
| 6 | + alias python=python3 | |
| 7 | +fi | |
| 8 | +#alias python=python3 | |
| 3 | 9 | alias Vim='vim ~/.vimrc' |
| 4 | 10 | alias Gvim='vim ~/.ghost/ghost.vimrc' |
| 5 | 11 | alias Gbash='vim ~/.ghost/ghost.sh' |
| @@ -8,11 +14,11 @@ alias Bash='vim ~/.bashrc' | ||
| 8 | 14 | alias Source='source ~/.bashrc' |
| 9 | 15 | alias gcom='git add . && git commit -m' |
| 10 | 16 | alias ghook='~/.ghost/ghook/startproject.sh' |
| 11 | -alias venv='python3 -m venv venv' | |
| 17 | +alias venv='python -m venv venv' | |
| 12 | 18 | function vsource() { |
| 13 | 19 | local start=`pwd` |
| 14 | 20 | for i in $(seq 1 5);do |
| 15 | - if ! source venv/bin/activate; then | |
| 21 | + if ! source venv/**/activate; then | |
| 16 | 22 | cd .. |
| 17 | 23 | else |
| 18 | 24 | cd $start |
| @@ -28,3 +34,21 @@ function Gpush() { | ||
| 28 | 34 | git push -u origin main |
| 29 | 35 | cd $start |
| 30 | 36 | } |
| 37 | +function Djs() { | |
| 38 | + local start=`pwd` | |
| 39 | + for i in $(seq 1 5);do | |
| 40 | + if test -f manage.py;then | |
| 41 | + python manage.py runserver $1 | |
| 42 | + break | |
| 43 | + fi | |
| 44 | + done | |
| 45 | +} | |
| 46 | +function Dj() { | |
| 47 | + local start=`pwd` | |
| 48 | + for i in $(seq 1 5);do | |
| 49 | + if test -f manage.py;then | |
| 50 | + python manage.py $@ | |
| 51 | + break | |
| 52 | + fi | |
| 53 | + done | |
| 54 | +} |