-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
182 lines (132 loc) · 4.14 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
# -- Local Override ----------
if [ -f ~/.localrc-pre ]; then
. ~/.localrc-pre
fi
# -- Theme Engine ----------
ENGINE_OH_MY_ZSH=1
ENGINE_POWERLINE=2
# THEME_ENGINE=$ENGINE_POWERLINE
THEME_ENGINE=$ENGINE_OH_MY_ZSH
# -- Oh My Zsh ----------
if [ $THEME_ENGINE = $ENGINE_OH_MY_ZSH ]; then
# Disable warning on mac
ZSH_DISABLE_COMPFIX=true
# Path to your oh-my-zsh configuration.
ZSH=$HOME/Code/oh-my-zsh
# Set name of the theme to load.
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="jdob-g"
# ZSH_THEME="powerlevel9k/powerlevel9k"
# 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 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=(git docker sudo)
# plugins=(git python go oc sudo zsh-autosuggestions)
plugins=(git python go sudo)
# Start oh-my-zsh
source $ZSH/oh-my-zsh.sh
fi
# -- Powerline ----------
if [ $THEME_ENGINE = $ENGINE_POWERLINE ]; then
# There may be a better way of doing this, but for now this works across all of my machines
if [ -f /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh ]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh
fi
if [ -f /home/jdob/.local/lib/python3.6/site-packages/powerline/bindings/zsh/powerline.zsh ]; then
source /home/jdob/.local/lib/python3.6/site-packages/powerline/bindings/zsh/powerline.zsh
fi
fi
# -- Aliases ----------
alias less="less -FiX"
alias tree="tree -C"
alias ls="ls --color"
alias ll="ls -l"
alias ..="cd .."
alias watch="watch "
alias vi=vim
alias emacs=emacs -nw
alias k=kubectl
alias files="xdg-open ."
# -- Python ----------
WORKON_HOME=~/Code/.venvs
if [ -f /usr/bin/virtualenvwrapper.sh ]; then
source /usr/bin/virtualenvwrapper.sh
fi
# MacOS (maybe also Ubuntu?)
if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
source /usr/local/bin/virtualenvwrapper.sh
fi
# Ubuntu
if [ -f /usr/share/virtualenvwrapper/virtualenvwrapper.sh ]; then
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
fi
export VIRTUAL_ENV_DISABLE_PROMPT=1
# -- Go ----------
export GOPATH=$HOME/Code/.go
#export GOROOT=$HOME/Code/go-1.12
export PATH=$GOPATH/bin:$PATH
# -- kubectl ----------
export KUBE_EDITOR=vim
# -- Functions ----------
bb () {
$*
RESULT=$?
RESULT_TXT="FAILED"
SOUND="/home/jdob/.sounds/bb8-failure.wav"
if [ "$RESULT" -eq "0" ]; then
RESULT_TXT="SUCCESS"
SOUND="/home/jdob/.sounds/bb8-success.wav"
fi
notify-send "$RESULT_TXT :: $*"
if [ -f $SOUND ]; then
aplay "$SOUND" -q
fi
}
git-branch-cleanup () {
git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D
}
docker-clean() {
docker rm $(docker ps -a -q)
}
docker-image-clean() {
docker rmi $(docker images -q)
}
oc-running() {
oc get pods | grep -v deploy
}
# -- Misc ----------
setopt nocorrectall
bindkey '^[[1;5D' backward-word
bindkey '^[[1;5C' forward-word
# Not sure who is setting this, but GREP_OPTIONS is deprecated, so unset
# it here to silence the annoying message.
unset GREP_OPTIONS
# Not sure who is setting this, but it's getting in the way of system themes
unset LS_COLORS
# History
# HISTFILE=~/.zsh_history
# HISTSIZE=10000
# SAVEHIST=1000
unsetopt SHARE_HISTORY
export HISTCONTROL=erasedups:ignorespace
# Local Binaries
export PATH=~/.local/bin:~/Applications/bin:$PATH
# pywal
# (cat $HOME/.config/wpg/sequences &)
if [ -f ~/.cache/wal/sequences ]; then
(cat ~/.cache/wal/sequences &)
fi
# oh-my-zsh turns this on by default, meaning every cd will push the previous
# directory to the stack
unsetopt auto_pushd
# -- Local Override ----------
if [ -f ~/.localrc ]; then
. ~/.localrc
fi