-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
295 lines (241 loc) · 7.48 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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
## Activate Powerlevel10k Instant Prompt.
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
ZSH_AUTOSUGGEST_MANUAL_REBIND=1
WORDCHARS=''
# When searching for history entries in the line editor, do not display
# duplicates of a line previously found, even if the duplicates are not contiguous.
setopt histfindnodups
export VOLTA_HOME=~/.volta
typeset -U path PATH
path=(
$VOLTA_HOME/bin
~/.cargo/bin
~/.local/bin
~/.rd/bin
~/.node_modules/bin
$path
)
export PATH
eval "$(/opt/homebrew/bin/brew shellenv)"
# Must be called before Zim is initialized
fpath+=("$HOMEBREW_PREFIX/share/zsh/site-functions")
# granted
fpath+=($HOME/.granted/zsh_autocomplete/assume/)
fpath+=($HOMNE/.granted/zsh_autocomplete/granted/)
export GRANTED_DISABLE_UPDATE_CHECK=true
# ----------------------------------------------------------------------
# Zim
# use degit tool by default to install modules
zstyle ':zim:zmodule' use 'degit'
zstyle ':zim:input' double-dot-expand yes
zstyle ':zim:*' case-sensitivity sensitive
# Completion styling
# zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# zstyle ':completion:*' menu no
# zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
export ZIM_HOME=~/.zim
# Download zimfw plugin manager if missing.
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
fi
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
source ${ZIM_HOME}/zimfw.zsh init -q
fi
# Initialize modules.
source ${ZIM_HOME}/init.zsh
# ----------------------------------------------------------------------
# Disable ambiguous completion
#zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' '+r:|?=**'
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# Bash completion
autoload -Uz bashcompinit && bashcompinit
complete -C aws_completer aws
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_BAT=1
export HOMEBREW_NO_ENV_HINTS=1
export HOMEBREW_BUNDLE_FILE=~/.brewfile
export npm_config_prefix=~/.node_modules
export EDITOR=nvim
export VISUAL=nvim
export DIFFPROG='nvim -d'
export SUDO_EDITOR=nvim
export CLICOLOR=YES
export BROWSER=open
# Parevent creation of desktop files and file associations for wine applications
export WINEDLLOVERRIDES=winemenubuilder.exe,mscoree,mshtml=
export GROFF_NO_SGR=yes
export AWS_PAGER=
# sar
export S_COLORS=auto
export LS_COLORS="$(vivid generate {{ (index .theme .theme_name).vivid }})"
# less
export LESS_TERMCAP_mb=$'\E[1;31m' # Begins blinking.
export LESS_TERMCAP_md=$'\E[1;31m' # Begins bold.
export LESS_TERMCAP_me=$'\E[0m' # Ends mode.
export LESS_TERMCAP_ue=$'\E[0m' # Ends underline.
export LESS_TERMCAP_us=$'\E[1;32m' # Begins underline.
FZF_THEME_CATPPUCCIN_LATTE='
--color=bg+:#ccd0da,bg:#eff1f5,spinner:#dc8a78,hl:#d20f39
--color=fg:#4c4f69,header:#d20f39,info:#8839ef,pointer:#dc8a78
--color=marker:#dc8a78,fg+:#4c4f69,prompt:#8839ef,hl+:#d20f39'
FZF_THEME_CATPPUCCIN_MACCHIATO='
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796'
FZF_THEME_CATPPUCCIN_MOCHA='
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6f7,hl+:#f38ba8'
FZF_THEME_TOKYONIGHT_DAY='
--highlight-line
--info=inline-right
--ansi
--layout=reverse
--border=none
--color=bg+:#b7c1e3
--color=bg:#d0d5e3
--color=border:#4094a3
--color=fg:#3760bf
--color=gutter:#d0d5e3
--color=header:#b15c00
--color=hl+:#188092
--color=hl:#188092
--color=info:#8990b3
--color=marker:#d20065
--color=pointer:#d20065
--color=prompt:#188092
--color=query:#3760bf:regular
--color=scrollbar:#4094a3
--color=separator:#b15c00
--color=spinner:#d20065'
FZF_THEME_TOKYONIGHT_MOON='
--highlight-line
--info=inline-right
--ansi
--layout=reverse
--border=none
--color=bg+:#2d3f76
--color=bg:#1e2030
--color=border:#589ed7
--color=fg:#c8d3f5
--color=gutter:#1e2030
--color=header:#ff966c
--color=hl+:#65bcff
--color=hl:#65bcff
--color=info:#545c7e
--color=marker:#ff007c
--color=pointer:#ff007c
--color=prompt:#65bcff
--color=query:#c8d3f5:regular
--color=scrollbar:#589ed7
--color=separator:#ff966c
--color=spinner:#ff007c'
FZF_THEME_TOKYONIGHT_NIGHT='
--highlight-line
--info=inline-right
--ansi
--layout=reverse
--border=none
--color=bg+:#283457
--color=bg:#16161e
--color=border:#27a1b9
--color=fg:#c0caf5
--color=gutter:#16161e
--color=header:#ff9e64
--color=hl+:#2ac3de
--color=hl:#2ac3de
--color=info:#545c7e
--color=marker:#ff007c
--color=pointer:#ff007c
--color=prompt:#2ac3de
--color=query:#c0caf5:regular
--color=scrollbar:#27a1b9
--color=separator:#ff9e64
--color=spinner:#ff007c'
FZF_THEME_TOKYONIGHT_STORM='
--highlight-line
--info=inline-right
--ansi
--layout=reverse
--border=none
--color=bg+:#2e3c64
--color=bg:#1f2335
--color=border:#29a4bd
--color=fg:#c0caf5
--color=gutter:#1f2335
--color=header:#ff9e64
--color=hl+:#2ac3de
--color=hl:#2ac3de
--color=info:#545c7e
--color=marker:#ff007c
--color=pointer:#ff007c
--color=prompt:#2ac3de
--color=query:#c0caf5:regular
--color=scrollbar:#29a4bd
--color=separator:#ff9e64
--color=spinner:#ff007c'
FZF_THEME_ROSE_PINE_MOON='
--color=fg:#908caa,bg:#232136,hl:#ea9a97
--color=fg+:#e0def4,bg+:#393552,hl+:#ea9a97
--color=border:#44415a,header:#3e8fb0,gutter:#232136
--color=spinner:#f6c177,info:#9ccfd8,separator:#44415a
--color=pointer:#c4a7e7,marker:#eb6f92,prompt:#908caa'
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS$FZF_THEME_{{ (index .theme .theme_name).fzf }}
# TF
export TF_PLUGIN_CACHE_DIR=~/.terraform.d/plugin-cache
export TG_TF_FORWARD_STDOUT=true
export TG_PROVIDER_CACHE=true
export BUILDKIT_PROGRESS=plain
# Loki CLI
eval "$(logcli --completion-script-zsh)"
# Zellij
export ZELLIJ_AUTO_EXIT=true
{{ if eq .chezmoi.os "darwin" -}}
# Android Studio
export ANDROID_HOME=$HOME/Library/Android/sdk
{{- end }}
# k9s
export K9S_CONFIG_DIR=$HOME/.config/k9s
# Specify which neovim configuration folder to use
export NVIM_APPNAME=nvim-lazy
# Use EMACS emulation mode
bindkey -e
KEYTIMEOUT=10
# Up
autoload -Uz up-line-or-beginning-search
zle -N up-line-or-beginning-search
bindkey $terminfo[kcuu1] up-line-or-beginning-search
bindkey '^[[A' up-line-or-beginning-search
# Down
autoload -Uz down-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey $terminfo[kcud1] down-line-or-beginning-search
bindkey '^[[B' down-line-or-beginning-search
# Aliases
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias batp='bat --paging=auto'
alias chmod='chmod -v'
alias chown='chown -v'
alias cp='cp -v'
alias dig='dig +noall +answer +stats'
alias gap='git add --patch'
alias grep='grep --color=auto'
alias jq='jaq'
alias k='kubectl'
alias lg='lazygit'
alias ls='gls --color=auto'
alias ll='ls -lh'
alias lsports='ss -tunalp | column -t'
alias mv='mv -v'
alias rm='rm -v'
alias vim='nvim'
[[ -f ~/.functions.sh ]] && source ~/.functions.sh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh