-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc.local
161 lines (136 loc) · 4.76 KB
/
.zshrc.local
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
# The following lines were added by compinstall
zstyle ':completion:*' completer _complete _ignored _approximate
zstyle :compinstall filename "$HOME/.zshrc.local"
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
autoload colors
colors
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"
PROMPT="[%n@%m] ${smiley} %# "
RPROMPT='%~'
WORDCHARS=${WORDCHARS//\/}
if [ -f /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Virtualenv support
function virtual_env_prompt () {
REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) }
}
grml_theme_add_token virtual-env -f virtual_env_prompt '%F{magenta}' '%f'
zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent
alias ls='ls --color=auto'
if [ $commands[gdircolors] ]; then
eval $(gdircolors -b)
else
eval $(dircolors -b)
fi
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export CLICOLOR=1
zstyle ':completion:*:default' list-colors ''
export GREP_COLOR="1;33"
alias grep='grep --color=auto'
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
unalias ag 2>/dev/null || true
alias ag='ag --path-to-ignore ~/.ignore'
unalias ago 2>/dev/null || true
alias ago='ag --path-to-ignore ~/.ignore --go'
viag() { vim -c "Ag $*" }
# SP ' ' 0x20 = · U+00B7 Middle Dot
# TAB '\t' 0x09 = → U+FFEB Halfwidth Rightwards Arrow
# CR '\r' 0x0D = § U+00A7 Section Sign (⏎ U+23CE also works fine)
# LF '\n' 0x0A = ¶ U+00B6 Pilcrow Sign (was "Paragraph Sign")
alias whitespace="sed 's/ /·/g;s/\t/→/g;s/\r/§/g;s/$/¶/g'"
alias k=kubectl
# alias docker=podman
alias ssh="kitty +kitten ssh"
export PATH=${KREW_ROOT:-$HOME/.krew}/bin:$HOME/bin:$(go env GOPATH)/bin:$HOME/.local/bin:$PATH
export GOPATH=$(go env GOPATH)
export EDITOR=/bin/vim
export VISUAL=/bin/vim
stty stop undef
if [ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
elif [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
elif [ -f /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
if [ -f ~/.fzf.zsh ]; then
source ~/.fzf.zsh
else
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
fi
export FZF_COMPLETION_TRIGGER='~~'
export WORKON_HOME=~/.virtualenvs
if [ -f /usr/share/virtualenvwrapper/virtualenvwrapper.sh ]; then
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
elif [ -f /usr/bin/virtualenvwrapper.sh ]; then
source /usr/bin/virtualenvwrapper.sh
fi
export GIT_SSH=/usr/bin/ssh
export QT_STYLE_OVERRIDE=adwaita
export GTK_THEME=Adwaita:dark
export DOCKER_BUILDKIT=1
export ANSIBLE_NOCOWS=1
batdiff() {
git diff --name-only --diff-filter=d 2>/dev/null | xargs bat --diff
}
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
eval "$(<~/.ssh-agent-thing)"
fi
if [ $commands[minikube] ]; then
source <(minikube completion zsh)
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
if [ ! -f $HOME/.kube/config ]; then
mkdir -p $HOME/.kube
touch $HOME/.kube/config
fi
export KUBECONFIG=$HOME/.kube/config
fi
if [ $commands[pip3] ]; then
source <(pip3 completion --zsh)
elif [ $commands[pip] ]; then
source <(pip completion --zsh)
fi
if [ -f /usr/bin/aws_zsh_completer.sh ]; then
source /usr/bin/aws_zsh_completer.sh
fi
for c in kubectl kind helm clusterctl; do
if [ $commands[$c] ]; then
source <($c completion zsh)
fi
done
if [ -f /usr/share/nvm/init-nvm.sh ]; then
source /usr/share/nvm/init-nvm.sh
fi
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
if [ $commands[terraform] ]; then
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/local/bin/terraform terraform
fi
fortune | cowsay -n
# on WSL2
#export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0