-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdotzshrc
244 lines (176 loc) · 6.75 KB
/
dotzshrc
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
# oh my zsh configuration
export ZSH=$HOME/.oh-my-zsh
export ZSH_THEME=""
plugins=(
colored-man-pages
cargo
# ctrl+o copies current command
copybuffer
# see: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/debian
# debian
# adds encode64 / decode64 commands (alias e64 / d64)
encode64
# press ctrl-z to toggle vim. (instead of ctrl-z <-> fc command)
fancy-ctrl-z
# see https://github.com/sharkdp/fd
fd
# https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
git
golang
# adds pp_json, is_json, urlencode_json and urldecode_json.
jsontools
# see nmap aliases: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
nmap
# adds node-docs command. eg $ node-docs fs, $ node-docs path
node
# adds npm aliases: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
npm
nvm
pep8
pip
# adds rsync aliases https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git
rsync
rust
# prevent code from running when pasting into shell: gives chance to review first.
safe-paste
# see: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ssh-agent
# ssh-agent
# press escape twice to prepend sudo. words mid-command or after sudo denial.
sudo
# adds systemd aliases: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/systemd
# systemd
# adds urlencode and urldecode commands
urltools
# see: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vi-mode
# vi-mode
)
source $ZSH/oh-my-zsh.sh
# note: follow manual install instructions for sindresorhus pure theme
# https://github.com/sindresorhus/pure
fpath+=$HOME/.zsh/pure
autoload -U promptinit; promptinit
prompt pure
########################
### ENVIRONMENT VARS ###
########################
setopt ALL_EXPORT # automatically exports all parameters (up until unsetopt ALL_EXPORT)
unsetopt EQUALS # disable zsh filename substitution on '=' character.
# TERMINAL=/bin/urxvt
# https://stackoverflow.com/questions/18880024/start-ssh-agent-on-login
# SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
PATH=~/bin${PATH:+:${PATH}}
PATH=~/.cargo/bin:$PATH
PATH=~/.npm-global/bin:$PATH
PATH=/usr/local/go/bin:~/go/bin:$PATH
EDITOR=vim
VISUAL=vim
FCEDIT=vim
PAGER=less
MANPAGER=less
# LIBVIRT_DEFAULT_URI='qemu:///system'
# make the history file huge, use ctrl-r every day
HISTFILE=$HOME/.zhistory
HISTSIZE=1000000
SAVEHIST=1000000
#### oh-my-zsh specific environment variables
# Disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
# Uncomment to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
# Uncomment to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment 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"
# Uncomment if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="yyyy-mm-dd"
# case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment to enable command auto-correction.
# ENABLE_CORRECTION="true"
#### end of oh-my-zsh specific environment variables
###############
### Colors ###
###############
if [ "$(uname)" == "Darwin" ]; then
CLICOLOR=1
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
alias ls='ls --color'
fi
# Dan's preferred ls color options. (shows media files as dark green, archives as bright blue, etc.)
# handy post on configuring:
# http://blog.twistedcode.org/2008/04/lscolors-explained.html
#
# to see the full ls color map, run this command:
# dircolors --print-database
LS_COLORS='no=00:fi=00:di=00;34:ln=00;35:pi=40;33:so=01;36:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=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:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
# add colors where reasonable
alias diff='diff --color=auto'
GREP_COLOR='0;35' # magenta instead of red
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
LESS="-RimWJ"
# solarized man pages. modified from: https://github.com/zlsun/solarized-man
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[0;37;102m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[4;32m") \
PAGER="less" \
man "$@"
}
unsetopt ALL_EXPORT
#############################
### HISTORY CONFIGURATION ###
#############################
# note:
# most history setopts are already properly configured by oh-my-zsh.
# most notably, making all shells share and append to the same history file. see:
# https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/history.zsh
# remove superfluous blanks from each command line being added to the history list.
setopt HIST_REDUCE_BLANKS
################
### BINDKEYS ###
################
# make up and down arrows act as prefix-matching history completion
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
### try this configuration if delete key fails
# stty erase ^H
###############
### PLUGINS ###
###############
########################
### MORE ZSH OPTIONS ###
########################
# a nice list here:
# http://www.cs.elte.hu/zsh-manual/zsh_16.html
setopt NO_BEEP
setopt NO_FLOW_CONTROL # disable ctrl-s and ctrl-q
# setopt CORRECT # spellcheck-correct commands. comment out if too annoying.
setopt NO_MENU_COMPLETE
setopt NO_AUTO_MENU
# Set/unset shell options
#setopt notify globdots correct pushdtohome cdablevars autolist
#setopt correctall autocd recexact longlistjobs
#setopt autoresume histignoredups pushdsilent noclobber
#setopt autopushd pushdminus extendedglob rcquotes mailwarning
#unsetopt bgnice
unsetopt correct correctall
# after brew / apt install zsh-syntax-highlighting
# note: may need to correct the path
# source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh