-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_zshrc.tmpl
94 lines (73 loc) · 2.75 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
# =============================================================================================== #
# #
# __ __.__ __ .__ .___ ___ ___ ___________ #
# / \ / \__|/ |_| |__ __| _/______ _ __/ | \ __ _______ \_ _____/ _______ __ #
# \ \/\/ / \ __\ | \ / __ |/ __ \ \/ \/ / ~ \ | \__ \ | __)_ / \ \/ / #
# \ /| || | | Y \/ /_/ \ ___/\ /\ Y / | // __ \_| \ | \ / #
# \__/\ / |__||__| |___| /\____ |\___ >\/\_/ \___|_ /|____/(____ /_______ /___| /\_/ #
# \/ \/ \/ \/ \/ \/ \/ \/ #
# #
# =============================================================================================== #
# ---------
# znap
# ---------
# Download znap, if it's not there yet.
[[ -f ~/.znap/zsh-snap/znap.zsh ]] || {
mkdir ~/.znap
git clone --depth 1 -- https://github.com/marlonrichert/zsh-snap.git ~/.znap/zsh-snap
}
source ~/.znap/zsh-snap/znap.zsh
{{ if eq .zsh_theme "pure" -}}
znap prompt sindresorhus/pure
zstyle :prompt:pure:git:stash show yes
{{- else if and (eq .zsh_theme "starship") (lookPath "starship") }}
znap eval starship "starship init zsh --print-full-init"
znap prompt
{{- end }}
znap source zdharma-continuum/fast-syntax-highlighting
znap source zsh-users/zsh-autosuggestions
znap source zsh-users/zsh-completions
znap source ohmyzsh/ohmyzsh lib/completion.zsh
znap source ohmyzsh/ohmyzsh lib/history.zsh
znap source ohmyzsh/ohmyzsh lib/key-bindings.zsh
# ssh-agent
znap source ohmyzsh/ohmyzsh plugins/ssh-agent
zstyle :omz:plugins:ssh-agent agent-forwarding yes
# --------
# misc
# --------
ZSH=$HOME/.zsh
fpath+=$ZSH/completions
# path env functions
source $ZSH/shell_config/exports.sh
{{ if lookPath "thefuck" }}
# thefuck
znap eval fuck 'thefuck --alias'
{{- end }}
{{ if stat (joinPath .chezmoi.homeDir ".fzf" )}}
# fzf
source <(fzf --zsh)
{{- end }}
{{ if lookPath "zoxide" }}
# zoxide
znap eval zoxide 'zoxide init zsh'
{{- end }}
{{ if stat (joinPath .chezmoi.homeDir ".rye" )}}
# rye
pathprepend $HOME/.rye/shims
znap fpath _rye 'rye self completion -s zsh'
{{- end }}
{{ if stat (joinPath .chezmoi.homeDir ".cargo" "bin" "uv" )}}
# uv
znap fpath _uv 'uv generate-shell-completion zsh'
{{- end }}
{{ if stat (joinPath .chezmoi.homeDir ".atuin") }}
# atuin
source "$HOME/.atuin/bin/env"
znap eval atuin "atuin init zsh"
znap fpath _atuin 'atuin gen-completions --shell zsh'
{{ end }}
# alias
source $ZSH/shell_config/alias.sh
# remove duplicate path
normalize_path