-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
72 lines (56 loc) · 1.74 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
#!/usr/bin/env zsh
ZSH_DISABLE_COMPFIX=true
# automatically run `zgenom reset` if we modify our .zshrc
ZGEN_RESET_ON_CHANGE=("${HOME}/.zshrc")
# load zgenom
source "${HOME}/.zgenom/zgenom.zsh"
# if the init script doesn't exist
if ! zgenom saved; then
# oh-my-zsh
zgenom oh-my-zsh
# oh my zsh plugins
zgenom oh-my-zsh plugins/git
zgenom oh-my-zsh plugins/docker
# other plugins
zgenom loadall <<EOPLUGINS
{{ .standard_dirs.dot_dots | quote }}/completions
EOPLUGINS
# generate the init script from plugins above
zgenom save
fi
# automatically upgrade oh-my-zsh without asking
DISABLE_UPDATE_PROMPT=true
# load shell dotfiles
for file in {{ .standard_dirs.dot_dots | quote }}/.{secrets,exports,functions,aliases,extra}; do
[[ -r "${file}" ]] && [[ -f "${file}" ]] && source "${file}"
done
unset file
{{ if .is_mac -}}
# enable homebrew shell usage
eval "$(brew shellenv)"
{{- end }}
# use direnv for .env's if available
if type direnv &>/dev/null; then
eval "$(direnv hook zsh)"
fi
# run "on boot" script
if type deno &>/dev/null; then
if type chezmoi &>/dev/null; then
on_boot_main="script/lib/boot/main.ts"
on_boot_root="$(chezmoi source-path)"
[[ -n "${DOTFILES_SRC_PATH_OVERRIDE}" ]] && on_boot_root="${DOTFILES_SRC_PATH_OVERRIDE}"
# run in subshell to silence output and execute in background
("${on_boot_root}/${on_boot_main}" &>/dev/null &)
unset on_boot_main
unset on_boot_root
fi
fi
# use starship for a nice looking prompt
if ! type starship &>/dev/null; then
echo ""
echo "==============================================================="
echo "Hey! Go run the starship prompt install script in your dotfiles"
echo "==============================================================="
else
eval "$(starship init zsh)"
fi