-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
90 lines (75 loc) · 2.37 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
# 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
# Load External config in ~/.zsh.d
ZSHHOME="$HOME/.zsh.d"
if [ -d "$ZSHHOME" ] && [ -r "$ZSHHOME" ] && [ -x "$ZSHHOME" ]; then
for i in "$ZSHHOME"/*; do
# shellcheck disable=SC1090
[[ ${i##*/} = *.zsh ]] && { [ -f "$i" ] || [ -h "$i" ]; } && [ -r "$i" ] && . "$i"
done
fi
COMPLETION_HOME="$ZSHHOME/completions"
# load completion
fpath=("$COMPLETION_HOME" "$(brew --prefix)/share/zsh/site-functions" "${fpath[@]}")
# Auto suggestion text color
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=242'
# sheldon
if type sheldon &>/dev/null; then
eval "$(sheldon source)"
fi
# init completion
autoload -Uz compinit && compinit
# 1password completion
if type op &>/dev/null; then
eval "$(op completion zsh)"; compdef _op op
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.zsh.d/p10k.zsh ]] || source ~/.zsh.d/p10k.zsh
{{ if eq .chezmoi.os "linux" "darwin" -}}
{{ if eq .chezmoi.os "linux" -}}
# mise
MISE_EXECUTABLE="/home/linuxbrew/.linuxbrew/bin/mise"
{{ else if eq .chezmoi.os "darwin" -}}
# mise
MISE_EXECUTABLE="/opt/homebrew/bin/mise"
{{ end -}}
{{- end -}}
if [ -x "$MISE_EXECUTABLE" ]; then
eval "$($MISE_EXECUTABLE activate zsh)"
fi
# uv
if [ -x "$MISE_EXECUTABLE" ]; then
eval "$("$($MISE_EXECUTABLE which uv)" generate-shell-completion zsh)"
eval "$("$($MISE_EXECUTABLE which uvx)" --generate-shell-completion zsh)"
fi
# direnv
if type direnv &>/dev/null; then
eval "$(direnv hook zsh)"
fi
# fzf
if type fzf &> /dev/null; then
# shellcheck disable=SC1090
source <(fzf --zsh)
fi
# task
if type task &>/dev/null; then
eval "$(task --completion zsh)"
fi
# zoxide
if type zoxide &>/dev/null; then
eval "$(zoxide init zsh)"
fi
# chezmoi-managed-bin
CHEZMOI_BIN_DIR="$HOME/.chezmoi-bin"
[[ -e "$CHEZMOI_BIN_DIR" ]] && export PATH="$PATH:$CHEZMOI_BIN_DIR"
# proto
PROTO_HOME="$HOME/.proto";
export PATH="$PROTO_HOME/shims:$PROTO_HOME/bin:$PATH";
if type proto &>/dev/null; then
eval "$(proto activate zsh)"
fi
export PROTO_CONFIG_MODE="local"