-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
192 lines (158 loc) · 5.35 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
DOTFILES=$HOME/.dotfiles
# Powerlevel9K config
PATH="$HOME/bin:$PATH:$HOME/.local/bin"
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_CUSTOM_FAST_GIT="jose::fast_git"
POWERLEVEL9K_CUSTOM_FAST_GIT_BACKGROUND="green"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context kubecontext background_jobs custom_fast_git virtualenv newline dir)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator time)
POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-aheadbehind git-tagname)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=4
export TERM="xterm-256color"
export ZSH_AUTOSUGGEST_USE_ASYNC="true"
BREW_PREFIX=""
if [[ $(uname) == 'Darwin' ]]; then
BREW_PREFIX='/usr/local'
elif [[ $(uname) == 'Linux' ]] && [[ -d '/home/linuxbrew/.linuxbrew' ]]; then
BREW_PREFIX='/home/linuxbrew/.linuxbrew'
fi
export BREW_PREFIX
function _has_brew() {
if [[ -z "$BREW_PREFIX" ]]; then
return 1
fi
[[ -f "$BREW_PREFIX/bin/$1" ]]
}
source ~/.zplug/init.zsh
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
zplug "robbyrussell/oh-my-zsh", use:oh-my-zsh.sh
DISABLE_AUTO_UPDATE=true
if [[ $(uname) == 'Darwin' ]]; then
zplug "plugins/macos", from:oh-my-zsh
zplug "plugins/brew", from:oh-my-zsh
fi
zplug "plugins/git", from:oh-my-zsh
#zplug "plugins/aws", from:oh-my-zsh
zplug "plugins/kubectl", from:oh-my-zsh
zplug "plugins/tmux", from:oh-my-zsh
#zplug "plugins/kops", from:oh-my-zsh
zplug "plugins/helm", from:oh-my-zsh
zplug "plugins/httpie", from:oh-my-zsh
zplug "MichaelAquilina/zsh-you-should-use"
zplug "zsh-users/zsh-autosuggestions"
zplug "rupa/z", use:z.sh
zplug "dylanaraps/neofetch", as:command, use:neofetch
if [[ -z "$MINIMAL_ZSH" ]] || [[ "$MINIMAL_ZSH" == 'false' ]]; then
zplug "plugins/docker", from:oh-my-zsh
zplug "plugins/github", from:oh-my-zsh
zplug "plugins/mvn", from:oh-my-zsh
zplug "plugins/python", from:oh-my-zsh
zplug "plugins/pip", from:oh-my-zsh
zplug "plugins/rust", from:oh-my-zsh
zplug "plugins/terraform", from:oh-my-zsh
if ! _has_brew grpcurl; then
zplug 'fullstorydev/grpcurl', as:command, from:gh-r, rename-to:grpccurl
fi
if ! _has_brew yq; then
zplug "mikefarah/yq", as:command, from:gh-r, rename-to:yq
fi
if ! _has_brew stern; then
zplug "wercker/stern", as:command, from:gh-r, rename-to:stern
fi
if ! _has_brew fd; then
zplug "sharkdp/fd", as:command, from:gh-r, rename-to:fd
fi
if ! _has_brew bat; then
zplug "sharkdp/bat", as:command, from:gh-r, rename-to:bat, use:"*x86_64*linux-gnu*"
fi
if ! _has_brew hub; then
zplug "github/hub", from:gh-r, as:command, rename-to:hub, use:"*linux-amd64*"
fi
if ! _has_brew dive; then
zplug "wagoodman/dive", from:gh-r, as:command, rename-to:dive, use:"*linux_amd64.tar.gz"
fi
fi
zplug "$DOTFILES/fpath", from:local
if [[ $(uname -m) == 'x86_64' && -z "$DISABLE_PL9K" ]]; then
zplug "romkatv/powerlevel10k", use:powerlevel10k.zsh-theme
else
zplug mafredri/zsh-async, from:github
zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme
fi
zplug "zsh-users/zsh-syntax-highlighting", defer:2
if [[ -f $HOME/.private_zsh_plugins ]]; then
. $HOME/.private_zsh_plugins
fi
# Install zplug plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
if [ -f "$_zplug_lock" ]; then
rm "$_zplug_lock"
fi
zplug load
if [[ $(uname) == 'Linux' ]] && [[ -d /home/linuxbrew ]]; then
export PATH="$PATH:/home/linuxbrew/.linuxbrew/bin"
fi
if [[ -d "$HOME/.cargo" ]]; then
source $HOME/.cargo/env
fi
if [[ -f "$HOME/.private_zshrc" ]]; then
. $HOME/.private_zshrc
fi
. $DOTFILES/fun.zsh
bindkey -v
bindkey -M vicmd "^V" edit-command-line
bindkey '^ ' autosuggest-accept
if [[ -f /usr/libexec/java_home ]] && /usr/libexec/java_home > /dev/null 2>&1; then
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
fi
export HISTFILE=~/.zsh_history
export HISTSIZE=100000
export SAVEHIST=100000
#These two are used to prevent tmux panes from sharing history.
setopt noincappendhistory
setopt nosharehistory
# Use ! without confirmation.
unsetopt HIST_VERIFY
export EDITOR=vim
export VISUAL=vim
alias mrn="MAVEN_OPTS='-Dspring.profiles.active=local-dev,disable-auth' mvn spring-boot:run"
alias kgpg='kubectl get pods | grep'
alias kgpwg='kubectl get pods -w | grep'
alias gap="git add -p"
alias gpf='git push --force-with-lease'
alias norg='gron --ungron'
alias kc='kubectl'
alias pbld='python setup.py build && python setup.py install'
alias kgpa='kubectl get pods -a'
alias glr='git pull -r'
alias kgn='kubectl get node'
alias kdn='kubectl describe node'
alias tp='telepresence'
unalias kcp
_ORIGINAL_ATOM=$(which atom 2> /dev/null)
if [[ -n "$_ORIGINAL_ATOM" ]]; then
function _atom {
zsh -c "source $HOME/atom_venv/bin/activate; $_ORIGINAL_ATOM \"$@\""
}
alias atom="_atom"
fi
function kcmk {
_switch_context minikube $1
}
if ! which pbpaste 2>&1 > /dev/null; then
alias pbpaste='xclip -selection clipboard -o'
fi
if ! which pbcopy 2>&1 > /dev/null; then
alias pbcopy='xclip -selection clipboard'
fi
if [[ -f /usr/local/share/zsh/site-functions/_kubectl ]]; then
# for some reason this needs to be the last line here, or k8s autocompletion
# breaks down
source /usr/local/share/zsh/site-functions/_kubectl
fi
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh