-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvtter.plugin.zsh
125 lines (93 loc) · 2.12 KB
/
svtter.plugin.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/zsh
alias mkdir='mkdir -v'
alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'
alias ln='ln -v'
# git
function pushme() {
git push -u origin $(git branch --show-current)
}
function checkgit() {
if [ -z $(git diff --cached --exit-code) ];
then
echo "IT IS CLEAN"
else
echo "PLEASE COMMIT YOUR CHANGE FIRST!!!"
git status
fi
}
function ref() {
git add . && git commit -m "refactor: $1"
}
function feat() {
function unsafe_feat() {
git add . && git commit -m "feat: $1"
}
if [ -z $(git diff --cached --exit-code) ];
then
unsafe_feat $1
else
git commit -m "feat: $1"
fi
}
function docs() {
git add . && git commit -m "docs: $1"
}
function fix() {
git add . && git commit -m "fix: $1"
}
function chore() {
git add . && git commit -m "chore: $1"
}
function bump() {
feat "bump verison: " $1
}
# https://stackoverflow.com/questions/6916856/can-bash-show-a-functions-definition
alias ec="exec $SHELL"
alias eq="vim $ZSH_CUSTOM/plugins/svtter/svtter.plugin.zsh"
function setpy() {
alias pv="python3 -m venv venv"
alias ac="source venv/bin/activate"
alias newpy="cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git"
}
function unsetpy() {
unalias py
unalias ac
unalias newpy
}
function setdj() {
alias migrate="py manage.py migrate"
alias migration="py manage.py makemigrations"
alias run="py manage.py runserver"
alias st="source venv/bin/activate"
alias dj='python manage.py'
alias djr='dj runserver'
alias djdb='dj dbshell'
alias djs='dj shell'
alias djt='dj test'
}
function unsetdj () {
unalias migrate
unalias migration
unalias run
unalias st
unalias dj
unalias djr
unalias djdb
unalias djs
unalias djt
}
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
source "${0:A:h}/grpc.zsh"
source "${0:A:h}/python/total.zsh"
source "${0:A:h}/installer.zsh"
# docker
function build() {
docker build --build-arg netrc="$(cat ~/.netrc)" -t $1 .
}
function update_svtter() {
cd ~/.oh-my-zsh/custom/plugins/svtter && git pull
cd -
}