-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
264 lines (236 loc) · 7.23 KB
/
zshrc
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="frisk"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how many often would you like to wait before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(
autojump
brew
extract
git
#git-extra
git-flow
#git-open
gulp
heroku
macos
node
npm
tmux
vagrant
vi-mode
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# Customize to your needs...
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
#autoload bashcompinit
#bashcompinit
source ~/.git-completion.bash
source ~/.nvm/nvm.sh
nvm use v18.17.1
#zstyle ':completion:*:*:git:*' script ~/.git-completion.bash
# allow approximate
#zstyle ':completion:*' completer _complete _match _approximate
#zstyle ':completion:*:match:*' original only
#zstyle ':completion:*:approximate:*' max-errors 1 numeric
# tab completion for PID :D
#zstyle ':completion:*:*:kill:*' menu yes select
#zstyle ':completion:*:kill:*' force-list always
# cd not select parent dir
#zstyle ':completion:*:cd:*' ignore-parents parent pwd
# useful for path editing — backward-delete-word, but with / as additional delimiter
backward-delete-to-slash () {
local WORDCHARS=${WORDCHARS//\//}
zle .backward-delete-word
}
zle -N backward-delete-to-slash
setopt no_nomatch
# Normal aliases
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
alias ......='cd ../../../../../'
alias .1='cd ../'
alias .2='cd ../../'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
alias .6='cd ../../../../../../'
alias :q="exit"
alias 7za="7z a -mhe=on "
alias 7zap="7z a -mhe=on -p "
alias a="atom"
alias b='brew'
alias bc='brew cask'
alias bci='brew install --cask --appdir="/Applications"'
alias bcs='brew search'
alias bcu='brew uninstall --cask'
alias bi='brew install'
alias bs='brew search'
alias c="clear"
alias cask="brew cask"
alias cd..='cd ..'
alias cp="cp -iv"
alias csc="cat ~/.ssh/config"
alias dir='ls -1'
alias dm="docker-machine"
alias dme="docker-machine env"
alias do="docker"
alias doc="docker container"
alias dol="docker logs"
alias dom="docker-machine"
alias dome="docker-machine env"
alias dc="docker-compose"
alias dcd="docker-compose down"
alias dcr="docker-compose restart"
alias dcrm="docker-compose rm"
alias dcu="docker-compose up"
alias egrep='egrep --color=auto'
alias ex="exit"
alias f='find |grep'
alias fgrep='fgrep --color=auto'
alias fixme='grep "FIXME" -r .'
alias gb="git branch"
alias gbi="gitbook init"
alias gbs="gitbook serve"
alias gbc="git branch --merged | grep 'feature' | xargs -n 1 git branch -d"
alias gcb="git branch --merged | grep 'feature' | xargs -n 1 git branch -d"
alias gcl='git clone'
alias gcl1='git clone --depth 1'
alias gcm='git commit -m'
alias gco='git checkout'
alias gcod='git checkout develop'
alias gcom='git checkout master'
alias gcl1='git clone --depth=1'
alias gd="git diff"
alias gff='git flow feature finish'
alias gfs='git flow feature start'
alias ginf='git info'
alias ginfo='git info'
alias gn='grunt'
alias gnt='grunt test'
alias gns='grunt serve'
alias gpl='git pull'
alias gplod='git pull origin develop'
alias gplom='git pull origin master'
alias gplud='git pull upstream develop'
alias gplum='git pull upstream master'
alias gps='git push'
alias gpsod='git push origin develop'
alias gpsom='git push origin master'
alias grep='grep --color=auto'
alias greset="rm -rf .git && git init && git add . && git cm 'init' && git fi"
alias gt="git status"
alias glh="g l | head"
alias h='hexo'
alias hd='hexo generate -d'
alias hg='hexo generate'
alias hn='hexo new post'
alias hs='hexo server --watch'
alias lns='ln -s'
alias ls='ls -G' # Mac
alias ls='ls -FHG --color=auto' # Linux
alias lsa='ls -al'
alias lsd='ls -ld *(-/DN)'
alias lss='du -sh *' # List size
#alias m="meteor"
#alias ms="meteor --settings settings.json"
#alias mt="meteor"
alias mv="mv -v"
alias n="node"
alias ni="npm install"
alias nid="npm install --save-dev "
alias nis="npm install --save "
alias nr="npx playwright codegen "
alias nv="nvim"
alias ping='ping -c 5'
alias q="exit"
alias rake="noglob rake"
alias rm="rm -vi"
#alias rm='rm -i --preserve-root'
alias resetgit="rm -rf .git && git init && git add . && git cm 'init' && git fi"
alias sha='shasum -a 256 '
alias t='tree'
alias t2='tree -L 2'
alias t3='tree -L 3'
alias tl='tree -L'
alias todo="grep 'TODO' -r ."
alias tx='tmux'
alias txa='tmux attach'
alias txw='tmux attach -t work'
alias txc='tmux new -s'
alias untar='tar -zxvf '
alias vd='vimdiff'
alias v='nvim -p'
alias vc='vim ~/.ssh/config'
alias vi='vim -p'
alias vim='vim -p'
alias vin='vim -p'
#alias vg='vagrant'
#alias vgh='vagrant halt'
#alias vgs='vagrant ssh'
#alias vgu='vagrant up'
alias vs='code '
alias vsc='vim ~/.ssh/config'
alias vsk='vim ~/.ssh/known_hosts'
alias vt='vim ~/.tmux.conf'
alias vv='vim ~/.vimrc'
alias vw='vim ~/Library/Rime/wubi_pinyin.extended.dict.yaml'
alias vz='vim ~/.zshrc'
alias yd='youtube-dl'
alias w='cd ~/workspace/git/'
alias wget='wget -c'
alias ws='cd ~/workspace/git/'
alias z="exit"
alias ai="sudo apt-get install"
alias auu="sudo apt-get update && sudo apt-get upgrade"
alias mc="mycli -u user -p -A dbname"
alias rn="sudo service nginx restart"
alias rp="sudo service php7.2-fpm restart"
alias tn="sudo tail -f /var/log/nginx/*.log"
alias tp="sudo tail -f /var/log/php-fpm/*.log"
# command L equivalent to command |less
alias -g L='|less'
# command S equivalent to command &> /dev/null &
alias -g S='&> /dev/null &'
alias -g G='|grep'
# Add autojump.sh
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
# Add bash completion
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
. /opt/local/etc/profile.d/bash_completion.sh
fi
### Added by the Heroku Toolbelt
# export PATH="/usr/local/heroku/bin:$PATH"
# Add iterm2
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# Add nvm source
source /usr/local/opt/nvm/nvm.sh
eval $(thefuck --alias)
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion