-
Notifications
You must be signed in to change notification settings - Fork 5
/
.zshrc
197 lines (157 loc) · 4.58 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
# author :tracyone
# date :2013-08-25/17:25:29
# lastchange :2014-02-23/01:20:00
# ---------------------------------------------------
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# for faster loading,we use zsh buildin command zcompile
# to compile the .zshrc
if [ ! -f ~/.zshrc.zwc -o ~/.zshrc -nt ~/.zshrc.zwc ]; then
zcompile ~/.zshrc
fi
# environment {{{
export EDITOR=vim
export LANG=en_US.UTF-8
# Better umask
umask 022
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
# Print core files?
#unlimit
#limit core 0
#limit -s
#limit coredumpsize 0
# improved less option
export LESS='--tabs=4 --no-init --LONG-PROMPT --ignore-case --quit-if-one-screen --RAW-CONTROL-CHARS'
export MGLS_LICENSE_FILE="C:\\flexlm\\license.dat"
export SVN_EDITOR=vim
export MINICOM='-m -c on'
OS=$(uname)
# }}}
# keybinds {{{
# emacs keybinds
bindkey -e
# History completion
# autoload history-search-end
# zle -N history-beginning-search-backward-end history-search-end
# zle -N history-beginning-search-forward-end history-search-end
# bindkey "^p" history-beginning-search-backward-end
# bindkey "^n" history-beginning-search-forward-end
bindkey -M emacs '^P' history-substring-search-up
bindkey -M emacs '^N' history-substring-search-down
# Like bash
bindkey "^u" backward-kill-line
# }}}
# oh-my-zsh setting {{{
# 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="mortalscumbag"
# 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 often before auto-updates occur? (in days)
export UPDATE_ZSH_DAYS=30
# 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 to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# {{{plugin setting
# 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=(git OSX autojump history-substring-search command-not-found \
svn web-search zshmarks github git-flow sudo fzf-tab )
zmodload zsh/terminfo
source $ZSH/oh-my-zsh.sh
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit promptinit
compinit
# }}}
# }}}
# aliases {{{
# Global aliases {{{
alias -g A="| awk"
alias -g G="| grep"
alias -g GV="| grep -v"
alias -g H="| head"
alias -g L="| $PAGER"
alias -g P=' --help | less'
alias -g R="| ruby -e"
alias -g S="| sed"
alias -g T="| tail"
alias -g V="| vim -R -"
alias -g U=' --help | head'
alias -g W="| wc"
# }}}
# you can type filename with following subffix and zsh will open it with default specifial command
# Suffix aliases {{{
alias -s zip=zipinfo
alias -s tgz=gzcat
alias -s gz=gzcat
alias -s tbz=bzcat
alias -s bz2=bzcat
alias -s java=vim
alias -s c=vim
alias -s h=vim
alias -s C=vim
alias -s cpp=vim
alias -s txt=vim
alias -s xml=vim
alias -s html=chrome
alias -s xhtml=chrome
alias -s gif=display
alias -s jpg=display
alias -s jpeg=display
alias -s png=display
alias -s bmp=display
alias -s mp3=amarok
alias -s m4a=amarok
alias -s ogg=amarok
alias -s gz='tar -xzvf'
alias -s bz2='tar -xjvf'
alias -s zip='unzip'
# }}}
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#}}}
for file in ~/.{path,exports,aliases,functions,extra}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
# Functions {{{
# source config
r() {
source ~/.zshrc
if [ -d ~/.zsh/comp ]; then
# Reload complete functions
local f
f=(~/.zsh/comp/*(.))
unfunction $f:t 2> /dev/null
autoload -U $f:t
fi
}
# }}}
# other {{{
# {{{tmux
which tmux > /dev/null
if [[ $? -eq 0 ]]; then
case $- in *i*)
[ -z "$TMUX" ] && exec $(TERM=xterm-256color tmux -2)
esac
fi
# }}}"
export GTAGSCONF=/usr/local/etc/gtags.conf
export GTAGSLABEL=native-pygments
# }}}
# vim: set fdm=marker foldlevel=0:
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh