-
Notifications
You must be signed in to change notification settings - Fork 2
/
dot_zshrc.tmpl
114 lines (95 loc) · 3.46 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
export PATH="$HOME/.yarn/bin:$PATH"
export PATH="$HOME/.zi/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$GOPATH/bin:$PATH"
export PATH="$HOME/.bin:$PATH"
export PATH="${HOME}/.pyenv/shims:${PATH}"
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH="/sbin:$PATH"
{{- if eq .chezmoi.os "darwin" }}
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"
# export PATH="/usr/local/opt/python/libexec/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
{{- end }}
{{- if eq .chezmoi.os "linux" }}
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
{{- end }}
{{- if .enable.android }}
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH
{{- end }}
export PATH=$(python3 -m site --user-base)/bin:$PATH
export PATH=$HOME/.rbenv/shims:$GEM_HOME/bin:$PATH
export PATH=$HOMEBREW_PREFIX/bin:$PATH
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
if [ -d "$HOME/.volta" ]; then
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
fi
if [ -d "$HOME/.foundry/bin" ]; then
export PATH="$PATH:$HOME/.foundry/bin"
fi
{{- if .enable.rust }}
if [ -f $HOME/.cargo/env ]; then
source "$HOME/.cargo/env"
export PATH="$PATH:$HOME/.cargo/bin"
fi
{{- end }}
export GPG_TTY=$(tty)
# Aliases
. $HOME/.zsh/aliases.zsh
# Functions
. $HOME/.zsh/functions.zsh
{{- if eq .chezmoi.os "linux" }}
. $HOME/.zsh/linux_env.zsh
{{- end }}
# Bootstrap
. $HOME/.zsh/bootstrap.zsh
{{ if eq .chezmoi.os "darwin" }}
[ -f "${HOME}/.iterm2_shell_integration.zsh" ] && . "${HOME}/.iterm2_shell_integration.zsh"
{{ end }}
# External plugins (initialized after)
. $HOME/.zsh/plugins_after.zsh
# Allow local customizations loading ~/.zsh-load folder
if [ -d "$HOME/.zsh-load" ];then
for TO_LOAD in $HOME/.zsh-load/*
do
. $TO_LOAD
done
unset TO_LOAD
fi
# Need a tweak in arch for home and end keys to work properly
# (as well as insert, delete, pageup, pagedown, perhaps others...)
# https://wiki.archlinux.org/index.php/Home_and_End_keys_not_working#Zsh
bindkey "^[[2~" overwrite-mode # Ins
bindkey "^[[3~" delete-char # Del
# but.... home and end key escape sequences
# are DIFFERENT depending on whether I'm in a tmux session or not!
# To determine if tmux is running, examine values of $TERM and $TMUX.
if [[ "$TERM" =~ "screen" ]] && [ -n "$TMUX" ]; then
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
else
# Assign these keys if tmux is NOT being used:
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
fi
eval "$(starship init zsh)"
command -v dircolors &>/dev/null && eval `dircolors ~/.dircolors/theme`
command -v gdircolors &>/dev/null && eval `gdircolors ~/.dircolors/theme`
{{- if .enable.onepassword }}
{{ if eq .chezmoi.os "darwin" }}
if [ -d ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t ]; then
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
else
type ssh-agent &> /dev/null && eval $(ssh-agent) &> /dev/null
fi
{{- end }}
{{ else }}
type ssh-agent &> /dev/null && eval $(ssh-agent) &> /dev/null
{{- end }}
printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "zsh"}}\x9c'