-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_zshrc.tmpl
125 lines (98 loc) · 4.03 KB
/
dot_zshrc.tmpl
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
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
fpath=($HOMEBREW_PREFIX/share/zsh-completions $HOMEBREW_PREFIX/share/zsh/site-functions $fpath)
for file in ~/.{functions,exports,paths,prompt,aliases,extra,auths,historyopts}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done
function powerline_precmd() {
ZLE_RPROMPT_INDENT=-1
eval "$($(go env GOPATH)/bin/powerline-go -error $? -shell zsh -eval -cwd-max-depth 4 -git-mode compact -modules ssh,cwd,exit -modules-right git,hg,aws,kube)"
}
function install_powerline_precmd() {
for s in "${precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
if [ "$TERM" != "linux" ]; then
install_powerline_precmd
fi
source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $HOMEBREW_PREFIX/share/zsh-history-substring-search/zsh-history-substring-search.zsh
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+l:|=* r:|=*'
zstyle ':completion:*' ignored-patterns 'kubectl.docker'
# Faster! (?)
zstyle ':completion::complete:*' use-cache 1
# case insensitive completion
#zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# color code completion!!!! Wohoo!
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
eval "$(direnv hook zsh)"
autoload -Uz compinit && compinit -i
{{- if ne .chezmoi.hostname "A6436902" }}
source "$HOMEBREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
source "$HOMEBREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
source <(kops completion zsh)
{{- end }}
source <(stern --completion zsh)
source <(docker completion zsh)
source <(kubectl completion zsh)
source <(kind completion zsh)
source <(chezmoi completion zsh)
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/argoyle/.sdkman"
[[ -s "/Users/argoyle/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/argoyle/.sdkman/bin/sdkman-init.sh"
autoload -U +X bashcompinit && bashcompinit
autoload -U zmv
complete -o nospace -C terraform terraform
set -o emacs
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# BEGIN_AWS_SSO_CLI
# AWS SSO requires `bashcompinit` which needs to be enabled once and
# only once in your shell. Hence we do not include the two lines:
#
# autoload -Uz +X compinit && compinit
# autoload -Uz +X bashcompinit && bashcompinit
#
# If you do not already have these lines, you must COPY the lines
# above, place it OUTSIDE of the BEGIN/END_AWS_SSO_CLI markers
# and of course uncomment it
__aws_sso_profile_complete() {
local _args=${AWS_SSO_HELPER_ARGS:- -L error}
_multi_parts : "($(/opt/homebrew/bin/aws-sso ${=_args} list --csv Profile))"
}
aws-sso-profile() {
local _args=${AWS_SSO_HELPER_ARGS:- -L error}
if [ -n "$AWS_PROFILE" ]; then
echo "Unable to assume a role while AWS_PROFILE is set"
return 1
fi
eval $(/opt/homebrew/bin/aws-sso ${=_args} eval -p "$1")
if [ "$AWS_SSO_PROFILE" != "$1" ]; then
return 1
fi
}
aws-sso-clear() {
local _args=${AWS_SSO_HELPER_ARGS:- -L error}
if [ -z "$AWS_SSO_PROFILE" ]; then
echo "AWS_SSO_PROFILE is not set"
return 1
fi
eval $(/opt/homebrew/bin/aws-sso ${=_args} eval -c)
}
compdef __aws_sso_profile_complete aws-sso-profile
complete -C /opt/homebrew/bin/aws-sso aws-sso
# END_AWS_SSO_CLI
[[ -z "$TMUX" && ("$TERM" == "rio" || "$TERM" == "alacritty" || "$TERM" == "xterm-256color" || "$TERM" == "xterm-ghostty") ]] && { tmux attach || exec tmux new-session && exit; }
typeset -U path
typeset -U manpath