-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
211 lines (166 loc) · 5.16 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
#! /usr/bin/env zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Oh-My-Zsh cache dir - a lot of the plugins require this to be set.
ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/ohmyzsh"
mkdir -p $ZSH_CACHE_DIR/completions
setopt rm_star_silent
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTCONTROL=erasedups
HISTSIZE=10000
SAVEHIST=10000
bindkey -e
# End of lines configured by zsh-newuser-install
##
## Antigen - package manager (https://github.com/zsh-users/antigen)
##
case $(uname -s) in
Darwin)
source "/opt/homebrew/share/antigen/antigen.zsh"
;;
Linux)
source "${HOME}/.antigen/antigen.zsh"
;;
esac
# Load the oh-my-zsh's library
antigen use oh-my-zsh
antigen bundle colored-man-pages
antigen bundle command-not-found
antigen bundle common-aliases
antigen bundle git
antigen bundle johanhaleby/kubetail
# antigen bundle kube-ps1
antigen bundle kubectl
# antigen bundle pip
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
# antigen bundle autojump
antigen theme romkatv/powerlevel10k
antigen apply
##
## Build Environment
##
export PATH="$PATH:$HOME/bin:$HOME/src/github.com/dazoakley/dotfiles/bin"
export XDG_CONFIG_HOME=$HOME/.config
# Homebrew on Linux
if [ -d "/home/linuxbrew" ]; then
export HOMEBREW_NO_INSTALL_CLEANUP="1"
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
case $(uname -s) in
Darwin)
# /opt/homebrew set-up
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:/opt/homebrew/share/npm/bin:$PATH"
export NODE_PATH="/opt/homebrew/lib/node_modules"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
# Extra path for misc scripts
export PATH="$PATH:$HOME/Google Drive/bin"
# Homebrew
export LDFLAGS="-L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/sqlite/lib"
export CPPFLAGS="-I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/sqlite/include"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig"
# llvm 11 for crystal lang...
export PATH="/usr/local/opt/llvm@11/bin:$PATH"
;;
Linux)
# export LDFLAGS="-Wl,-rpath,$(pkg-config --libs openssl)"
# export CPPFLAGS="$(pkg-config --cflags openssl)"
# export CONFIGURE_OPTS="-with-openssl=$(brew --prefix openssl)"
;;
esac
##
## Editor settings
##
export EDITOR=$(which nvim)
export SVN_EDITOR=$EDITOR
export GIT_EDITOR=$EDITOR
# ASDF
export ASDF_DIR=$HOME/.asdf
if [ -d "$ASDF_DIR" ]; then
. $HOME/.asdf/asdf.sh
fpath=($ASDF_DIR/completions $fpath)
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
fi
autoload -Uz bashcompinit
bashcompinit
# The following lines were added by compinstall
zstyle :compinstall filename '/Users/dazoakley/.zshrc'
fpath+=~/.zfunc
autoload -Uz compinit
compinit
# End of lines added by compinstall
##
## Terminal colours (after installing GNU coreutils)
##
export TERM=xterm-256color
if [ "$TERM" != "dumb" ]; then
export LS_OPTIONS='--color=auto'
case $(uname -s) in
Darwin)
eval "$(gdircolors -b "$HOME/.dir_colors")"
;;
Linux)
eval "$(dircolors -b "$HOME/.dir_colors")"
;;
esac
fi
# Github CLI (hub)
eval "$(hub alias -s)"
# gpg
GPG_TTY="$(tty)"
export GPG_TTY
# kube
export KUBECONFIG="${KUBECONFIG:-$HOME/.kube/config}"
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
# golang
export GOPATH="$HOME/go"
export PATH="$PATH:$(go env GOPATH)/bin"
export GO111MODULE="on"
# autojump
[ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh
[ -f /home/linuxbrew/.linuxbrew/etc/profile.d/autojump.sh ] && . /home/linuxbrew/.linuxbrew/etc/profile.d/autojump.sh
##
## Other stuff
##
eval "$(kubectl completion zsh)"
eval "$(direnv hook zsh)"
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# kubectl config files
export KUBECONFIG=$(ls ~/.kube/{*.y*ml,config} | while read line
do
echo -n ${line}:
done
)
##
## my prompt theme...
##
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# HOSTNAME=$(hostname)
# KUBE_PS1_SYMBOL_PADDING=false
# KUBE_PS1_SEPARATOR=''
# KUBE_PS1_PREFIX='['
# KUBE_PS1_SUFFIX=']'
# PROMPT=$'%{$fg_bold[green]%}$HOSTNAME%{$reset_color%} %{$fg[yellow]%}%~%{$reset_color%}$(git_prompt_info) $(kube_ps1)\
# %{$fg_bold[green]%}%D{%H:%M} %{$fg[blue]%}❯%{$reset_color%} '
# ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%} ["
# ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
# ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
# ZSH_THEME_GIT_PROMPT_CLEAN=""
source ~/.aliases
##
## LOCAL ENV OVERRIDE (non-git hosted stuff)
##
if [ -f ~/.env_setup.local ]; then
. ~/.env_setup.local
fi
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"