forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
executable file
·358 lines (281 loc) · 8.3 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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# Local early bird overrides, modifications
[[ -s $HOME/.zshrc.local ]] && source $HOME/.zshrc.local
autoload -U colors && colors
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Theme to load - Look in ~/.oh-my-zsh/themes/ or set to "random"
#ZSH_THEME="gnzh"
#ZSH_THEME="agnoster" # Nice boldly-colored line highlighters, but needs special font
ZSH_THEME="random"
# awesomepanda - nice and simple; bold so sticks out fairly well, but not as well as agnoster
# crcandy - very nice; time, bold, git, location, server, user, simple prompt. Like it; could be more boldy
#ZSH_THEME=crcandy
#ZSH_THEME=tonotdo
ZSH_THEME=re5et
# colored though
#
# Otherwise fucks with tmux window naming
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=()
# Enables autojump ocation to be overridden on a local basis - need for fhcrc servers
autojump=/usr/share/autojump/autojump.zsh
# Main path list. Can be added to with ~/.zshrc.local
#export PATH=/usr/local/bin:/app/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/sbin
[[ -s /home/matsengrp ]] && export R_LIBS_SITE=~matsengrp/local/R-packages
export [email protected]
#export PATH=/usr/local/bin:$HOME/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/sbin:/app/bin
export PATH=$HOME/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/bin:/app/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/sbin:$PATH
export NVM_DIR="$HOME/.nvm"
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && . "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm
export PATH=$HOME/.local/bin:$PATH
export PATH=$HOME/local/bin:$HOME/bin:$HOME/Dropbox/bin:$PATH
# Load oh my zsh
source $ZSH/oh-my-zsh.sh
# I've decided maybe autocorrection IS maybe more trouble than worth...
unsetopt correct_all
# Ocaml dev settings
export OCAMLRUNPARAM=b
# Load rvm if present
[[ -s "/home/$USER/.rvm/scripts/rvm" ]] && source "/home/$USER/.rvm/scripts/rvm"
# Add RVM to PATH for scripting
export PATH=$PATH:$HOME/.rvm/bin
# Sets diff to colordiff if present
which colordiff > /dev/null && alias diff="colordiff"
# These are from http://www.f30.me/2012/10/oh-my-zsh-key-bindings-on-ubuntu-12-10/
# Solves no up-line-or-search functionality from oh-my-zsh. Try removing periodically. Appears to be a cleaner
# patch which may be going to omzsh - XXX
#bindkey "${terminfo[kcuu1]}" up-line-or-search
#bindkey "${terminfo[kcud1]}" down-line-or-search
# This is disables the Ctrl-S Xoff feature of the shell
stty -ixon
# Trying to increase the number of history items
HISTSIZE=100000
SAVEHIST=100000
# A few settings for my cheat sheets
export EDITOR='/usr/bin/gvim -v'
#alias vim='gvim -v'
alias vim=nvim
export CHEATCOLORS=true
# alias git to hub
#eval "$(hub alias -s)"
# ALIASES!!!!!!!!!!
# =================
# Listing aliases
alias ll='ls -hl'
alias la='ls -hla'
alias lat='ls -hlat'
alias wdid='ls -chlt | head'
alias l='ls -hl'
alias lt='ls -hlt'
alias files='nautilus'
alias tmux="TERM=screen-256color-bce tmux -2"
alias duh='du -hs'
alias less='TERM=xterm less -R'
alias svim='/usr/bin/vim' # since matsengrp vim doesn't seem to work on 1404
# quick zsh mods
alias rrc='source ~/.zshrc'
alias erc='vim ~/.zshrc'
# Other
alias ack='ack-grep'
alias xc='xclip -selection clip'
alias xp='xclip -selection clip -o'
alias sc='scons --debug explain'
alias scn='scons -n --debug explain'
alias evrc='vim ~/.vimrc'
alias sm='seqmagick'
alias smi='seqmagick info'
alias smc='seqmagick convert'
alias seqconv='seqmagick convert'
alias seqinfo='seqmagick info'
alias seqids='seqmagick extract-ids'
alias ccat='source-highlight -fesc -o STDOUT'
alias rtmc='rtm -c'
# removing bad dos carriage returns (mother fuckers)
alias dos2unix2="tr '\r' '\n' <"
# for babashka
alias bb-repl="bb --nrepl-server"
LEIN_JAVA_CMD=/usr/local/bin/drip
# run batches of jobs with salloc
sca() {
salloc -n $1 scons --debug explain -j $@
}
# Archeopterix helper
aptx() {
java -jar ~/bin/forester.jar -c ~/.aptxrc $1
}
# Reload shell
r () {
# Reload X tunells if in tmux
if [[ -n $TMUX ]]
then
NEW_SSH_AUTH_SOCK=`tmux showenv|grep "^SSH_AUTH_SOCK"|cut -d = -f 2`
if [[ -n $NEW_SSH_AUTH_SOCK ]] && [[ -S $NEW_SSH_AUTH_SOCK ]]
then
echo "New auth sock: $NEW_SSH_AUTH_SOCK"
SSH_AUTH_SOCK=$NEW_SSH_AUTH_SOCK
fi
NEW_DISPLAY=`tmux showenv|grep "^DISPLAY"|cut -d = -f 2`
if [[ -n $NEW_DISPLAY ]]
then
echo "New display: $NEW_DISPLAY"
DISPLAY=$NEW_DISPLAY
fi
fi
# Reload shell rc
rrc
}
# Readlink piped to xclip...
rl () {
if [[ -n $1 ]]
then
p=$1
else
p='.'
fi
readlink -f $p
}
rlxc () {
rl $1 | xc
}
# CSVKIT stuffs
csvless () {
csvlook $1 | less -S
}
tsvless () {
csvlook -t $1 | less -S
}
csvhead () {
head $@ | csvlook
}
csvtail () {
htail $@ | csvlook
}
addcol () {
csvstack -n $2 -g $3,nul $1 /dev/null
}
# Similarly, for json
# now this one is my own script with width control
#alias jsonlook='python -mjson.tool'
jsonless () {
jsonlook $@ | less -S
}
jsonhead () {
jsonlook $@ | head
}
htail () {
if [[ ! -n $2 ]]
then
n=10
else
n=$2
fi
head -n 1 $1
tail -n $n $1
}
avxless () {
av -L 99999 -w 99999 -cx $@ | less -S
}
avless () {
av -L 99999 -w 99999 -c $@ | less -S
}
alias avlook='av -L 10000 -w 10000 -c'
alias avlook='av -L 10000 -w 10000 -cx'
waid () {
ps ux --sort s | less -S
}
# Markdown converters
md2html () {
for i in $@
do
pandoc $i -s --css "http://matsen.fhcrc.org/webpage.css" -o $(basename $i .md).html
done
}
md2slidy () {
for i in $@
do
pandoc $i -s --css "http://matsen.fhcrc.org/webpage.css" --to=slidy -o $(basename $i .md).html
done
}
pdfjoin () {
pdftk $@ cat output joined.pdf
print "Joined pdf saved to joined.pdf!"
}
bindkey '\e.' insert-last-word
# For when my clutsy ass forgets to add things to a git commit
forgitadd () {
git reset --soft HEAD~1
git add .
git commit -c ORIG_HEAD
}
# Supposed to clip out the stderr; doesn't quite work yet...
alias stderrxc='2>&1 > /dev/null | xc'
# For evil deeds...
hdoze () {
if [[ -n $1 ]]
then
# Only parameter (optional) is height
height=$1
else
# Default window height is...
height=`xdpyinfo | grep dimensions | sed "s/.*[0-9]*x\([0-9]*\) pixels.*/\1/"`
((height=$height - 120))
fi
rdesktop -u fhcrc\\csmall -d FHCRC cbio-csmall.fhcrc.org -K -T "SHitB@rF" -g 1450x$height &
}
# mkcd
#
mkcd () {
mkdir -p $1
cd $1
}
# auto jump !
[[ -s $autojump ]] && . $autojump && autoload -U compinit && compinit
# Stuff for virtual env to be prettier
#export VIRTUAL_ENV_DISABLE_PROMPT=1
#function virtualenv_info() {
#if [ ! -z "$VIRTUAL_ENV" ]; then
#echo "(${VIRTUAL_ENV:t}) "
#fi
#}
#PROMPT="$PROMPT$(virtualenv_info)"
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
# If anything needs to be modified after everything has run
[[ -s $HOME/.zshrc.local.after ]] && source $HOME/.zshrc.local.after
export NVM_DIR="/home/csmall/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
export EISH_HOME=${HOME}/code/stedi/eish
export PATH=$PATH:$EISH_HOME
export AWS_DEFAULT_REGION=us-east-1
_direnv_hook() {
eval "$("/usr/bin/direnv" export zsh)";
}
typeset -ag precmd_functions;
if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
precmd_functions+=_direnv_hook;
fi
# Java version management
[ -s "/home/csmall/.jabba/jabba.sh" ] && source "/home/csmall/.jabba/jabba.sh"
export PATH="$PATH:/snap/bin"
export PATH="$PATH:$HOME/local/bin"
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/usr/local/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/usr/local/etc/profile.d/conda.sh" ]; then
. "/usr/local/etc/profile.d/conda.sh"
else
export PATH="/usr/local/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<