forked from alswl/.oOo.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
249 lines (210 loc) · 8.47 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
# Myself PATH {{{
#for p in `find $HOME/local -maxdepth 1 -type d -exec test -d {}/bin \; -print`; do
#PATH=$p/bin:$PATH
#done
PATH=$HOME/local/bin:/usr/local/bin:/usr/local/sbin:$PATH
PATH=$PATH:/Users/alswl/Library/Python/2.7/bin
#for p in `find /usr/local -maxdepth 1 -type d -exec test -d {}/bin \; -print`; do
#PATH=$p/bin:$PATH
#done
# PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH
# }}}
# ZSH Config {{{
# 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="powerline"
ZSH_THEME="robbyrussell"
#ZSH_THEME="kolo"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# 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 bower brew brew-cask colored-man compleat django docker docker-compose fabric gem git git-flow go golang gradle history history-substring-search httpie mvn nmap npm osx pip python redis-cli rsync rvm sbt scala screen ssh-agent sudo svn thefuck tmux urltools vagrant virtualenvwrapper xcode zsh_reload)
# virtualenvwrapper
source $ZSH/oh-my-zsh.sh
#export POWERLINE_RIGHT_B="none"
#export POWERLINE_HIDE_HOST_NAME="true"
# }}}
# Customize to your needs...
export EDITOR=vim
if [ `uname` = 'Darwin' ]; then
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
fi
[ -f ~/.nvm/nvm.sh ] && source ~/.nvm/nvm.sh
# personal script {{{
[ -f $HOME/.personal.sh ] && . $HOME/.personal.sh
# }}}
# 常用alias {{{
if [ `uname` = 'Darwin' ]; then
alias ls='ls -Gv'
alias b=brew
alias simulator='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
alias find=gfind
alias readlink=greadlink
alias p2a='pbpaste > /tmp/a.html && open /tmp/a.html'
alias p2v='pbpaste | vi -'
alias -g Toa=' > /tmp/a.html && open /tmp/a.html'
alias screen='TERM=xterm-256color /usr/local/bin/screen'
alias mute='osascript -e "set volume 0"'
alias unmute='osascript -e "set volume 2"'
alias find='gfind'
alias date='gdate'
alias sed='gsed'
alias sort='gsort'
elif [ `uname -s` = 'Linux' ] || [ `uname -o` = 'Cygwin' ]; then
alias ls="ls --color=auto"
fi
alias c='cat'
alias ll='ls -l'
alias llh='ls -lh'
alias la='ls -a'
alias mkdir='mkdir -p'
alias rmm='rm -R'
alias ..='cd ..'
alias mem='free -m'
alias less='less -i'
alias rv='rview'
alias dstat='dstat -cdlmnpsy'
alias grep='grep --exclude-dir=".svn" --color=auto'
alias tmux='tmux -2'
alias g=git
alias gc='git c'
alias gci='git ci'
alias gcv='git civ'
alias gpl='git pl'
alias gps='git ps'
alias gspl='git spl'
alias gsps='git sps'
alias gbr='git br'
alias gf='git f'
alias gs='git status'
alias gdf='git df'
alias gfuck='git reset --hard origin/master && git clean -fd'
alias gn='git number --column'
alias v=vim
alias mk=mkdir
alias le=less
alias psg='ps -ef | grep '
alias ipy=/Users/alswl/.virtualenvs/7/bin/ipython
alias py='python'
alias jy='jython'
alias ksh='killall ssh'
alias screen='TERM=xterm-256color screen'
alias s='sudo '
alias vd='vimdiff'
alias vdiff='vimdiff'
alias f='find . -name '
alias tarx='tar xzvf'
alias tarc='tar czvf'
alias e='echo'
alias vh='sudo vi /etc/hosts'
alias cnpm="npm --registry=https://registry.npm.taobao.org --cache=$HOME/.npm/.cache/cnpm --disturl=https://npm.taobao.org/dist --userconfig=$HOME/.cnpmrc"
alias fff='fuck'
alias wo='workon'
alias ta='tmux attach -t'
alias k='kill'
alias k9='kill -9 '
alias -g L='| less'
alias -g G='| grep --color=auto'
alias -g H='| head'
alias -g J='| json_pp | less'
alias -g W='| wc -l'
alias -g V='| vim -'
if [ `uname` = 'Darwin' ]; then
alias -g C='| pbcopy'
alias -g P='pbpaste'
fi
alias girl='man'
# }}}
# 路径别名 {{{
#hash -d WWW="/srv/http/" # use http instead
hash -d dt="/Users/alswl/duitang/"
hash -d japa="/Users/alswl/duitang/workspace/japa/"
hash -d mandala="/Users/alswl/duitang/workspace/mandala/"
hash -d faba="/Users/alswl/duitang/workspace/faba/"
hash -d titan="/Users/alswl/duitang/workspace/titan/"
hash -d nginx="/Users/alswl/duitang/workspace/nginx/"
hash -d desktop="/Users/alswl/Desktop/"
# }}}
# virtual wrapper {{{
#[ -f /usr/bin/virtualenvwrapper.sh ] && source /usr/bin/virtualenvwrapper.sh # arch
#[ -f /etc/bash_completion.d/virtualenvwrapper ] && source /etc/bash_completion.d/virtualenvwrapper # ubuntu
#}}}
# rvm {{{
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
# }}}
# arc {{{
[[ -s $HOME/local/arcanist/resources/shell/bash-completion ]] && source $HOME/local/arcanist/resources/shell/bash-completion
# }}}
# key binding {{{
bindkey '\e.' insert-last-word
#bindkey "\e[1~" beginning-of-line # Home
#bindkey "\e[4~" end-of-line # End
#bindkey "\e[5~" beginning-of-history # PageUp
#bindkey "\e[6~" end-of-history # PageDown
#bindkey "\e[2~" quoted-insert # Ins
#bindkey "\e[3~" delete-char # Del
#bindkey "\e[5C" forward-word
#bindkey "\eOc" emacs-forward-word
#bindkey "\e[5D" backward-word
#bindkey "\eOd" emacs-backward-word
#bindkey "\e\e[C" forward-word
#bindkey "\e\e[D" backward-word
#bindkey "\e[Z" reverse-menu-complete # Shift+Tab
# for rxvt
#bindkey "\e[7~" beginning-of-line # Home
#bindkey "\e[8~" end-of-line # End
# for non RH/Debian xterm, can't hurt for RH/Debian xterm
#bindkey "\eOH" beginning-of-line
#bindkey "\eOF" end-of-line
# for freebsd console
#bindkey "\e[H" beginning-of-line
#bindkey "\e[F" end-of-line
bindkey \^U backward-kill-line
bindkey "^x^e" edit-command-line
bindkey "[16~" delete-char # F5 pass to tmux
bindkey "[17~" delete-char # F6 pass to tmux
bindkey "[18~" delete-char # F7 pass to tmux
bindkey "[19~" delete-char # F8 pass to tmux
bindkey "^[[20~" delete-char # F9 pass to tmux
bindkey "^[[21~" delete-char # F10 pass to tmux
bindkey "^[[23~" delete-char # F11 pass to tmux
bindkey "[24~" delete-char # F12 pass to tmux
bindkey -M emacs '^P' history-substring-search-up
bindkey -M emacs '^N' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
# }}}
#color
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';
export LS_COLORS
# LANG
LANG="en_US.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
[[ -s /usr/share/source-highlight/src-hilite-lesspipe.sh ]] && export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
[[ -s /usr/local/bin/src-hilite-lesspipe.sh ]] && export LESSOPEN="| /usr/local/bin/src-hilite-lesspipe.sh %s"
#. ~/dev/project/shell/powerline/powerline/bindings/zsh/powerline.zsh
#eval "$(jenv init -)"