-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
executable file
·203 lines (164 loc) · 5.57 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
# shellcheck shell=bash
# @author Jeremy Hettenhouser
#
# Sources
# https://github.com/zdharma/zinit-configs/blob/master/numToStr/zshrc.zsh
# profiling
# zmodload zsh/zprof
# Zinit initialization -- assume prior install
source /home/linuxbrew/.linuxbrew/opt/zinit/zinit.zsh
# shellcheck disable=SC1009,SC1050,SC1054,SC1072,SC1073
{{- if eq .chezmoi.os "darwin" }}
export CLICOLOR="1"
# Huber prereqs
export PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig"
{{- else if eq .chezmoi.os "linux" }}
# linuxbrew is not installed on arm
if [[ "$(command -v brew)" ]]; then
if [[ -d /home/linuxbrew/.linuxbrew ]]; then
# Linuxbrew
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
elif [[ -d "$HOME/.linuxbrew" ]]; then
eval "$(${HOME}/.linuxbrew/bin/brew shellenv)"
fi
fi
{{- if eq .chezmoi.os "microsoft" }}
# WSL
# Hack: Solve slow FZF issue
unsetopt PATH_DIRS
{{ end }}
{{ else }}
{{ end }}
if [[ -z "$XDG_DATA_HOME" ]]; then
source "${HOME}/.zshenv"
fi
export ZSHZ_DATA="$XDG_DATA_HOME/z/.z"
# Wayland
export GDK_BACKEND=wayland
# Plugin config vars
export ZSHZ_DATA="$XDG_DATA_HOME/z/.z"
if ! [[ -f "$XDG_DATA_HOME/z" ]]; then
mkdir -p "$XDG_DATA_HOME/z"
touch "$ZSHZ_DATA"
fi
export ZSHZ_KEEP_DIRS=(/opt/net /net)
export ZSHZ_CASE=smart
# Pyenv
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
# Nodejs
export NVM_AUTO_USE=true
## Homebrew
export HOMEBREW_CASK_OPTS=--require-sha
export HOMEBREW_NO_INSECURE_REDIRECT=1
#GPG config
export GPG_TTY=$TTY
export EDITOR='vim'
export VISUAL='vim'
export SYSTEMD_EDITOR='vim'
export PYTHONIOENCODING=UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
##Maven
export MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED -Xms1024m -Xms2048m -Dmaven.artifact.threads=10"
export M2_HOME="$HOME/.m2"
# XDG script path
export PATH=$PATH:$HOME/.local/bin
# do not beep at me dammit
setopt NO_BEEP
# no c-s/c-q output freezing
setopt NO_FLOW_CONTROL
# allow expansion in prompts
setopt PROMPT_SUBST
# display PID when suspending processes as well
setopt LONG_LIST_JOBS
# try to avoid the 'zsh: no matches found...'
setopt NONOMATCH
# report the status of backgrounds jobs immediately
setopt NOTIFY
# whenever a command completion is attempted, make sure the entire command path
# is hashed first.
setopt HASH_LIST_ALL
# not just at the end
setopt COMPLETE_IN_WORD
# use zsh style word splitting
setopt NO_SH_WORD_SPLIT
# allow use of comments in interactive code
setopt INTERACTIVE_COMMENTS
# this is default, but set for share_history
setopt APPEND_HISTORY
# If the internal history needs to be trimmed to add the current command line, setting this option will cause the oldest history event that has a duplicate to be lost before losing a unique event from the list. You should be sure to set the value of HISTSIZE to a larger number than SAVEHIST in order to give you some room for the duplicated events, otherwise this option will behave just like HIST_IGNORE_ALL_DUPS once the history fills up with unique events.
setopt HIST_EXPIRE_DUPS_FIRST
# 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 HIST_FIND_NO_DUPS
# If a new command line being added to the history list duplicates an older one, the older command is removed from the list (even if it is not the previous event).
setopt HIST_IGNORE_ALL_DUPS
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
## History.
HISTFILE="${ZDOTDIR:-$HOME}/.zhistory"
HISTSIZE=90000
SAVEHIST=90000
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
# generic plugins to load early and traditionally
zi load atuinsh/atuin
zi light MichaelAquilina/zsh-you-should-use
zinit wait lucid for \
OMZP::mvn \
OMZP::npm \
OMZP::vscode \
OMZP::aws \
OMZP::brew \
OMZP::cp \
OMZP::gcloud \
OMZP::gpg-agent \
OMZP::ansible
# tools
zinit wait lucid for \
bindmap"^R -> ^H" atinit"
zstyle :history-search-multi-word page-size 10
zstyle :history-search-multi-word highlight-color fg=red,bold
zstyle :plugin:history-search-multi-word reset-prompt-protect 1
" \
zdharma-continuum/history-search-multi-word
# git completions, only when .git present
zinit wait lucid for \
OMZL::git.zsh \
OMZP::git \
OMZP::git-extras \
OMZP::tig \
OMZP::git-flow-avh \
OMZP::git-auto-fetch \
unixorn/git-extra-commands \
wfxr/forgit
zinit ice lucid wait='1'
zinit wait lucid for \
light-mode atinit"ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20" atload"_zsh_autosuggest_start" \
zsh-users/zsh-autosuggestions \
zsh-users/zsh-completions \
agkozak/zsh-z \
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
zdharma-continuum/fast-syntax-highlighting \
as"completion" is-snippet \
https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh \
https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.zsh \
https://github.com/docker/cli/blob/master/contrib/completion/zsh/_docker
zinit light-mode for \
pick"zsh-lazyload.zsh" \
qoomon/zsh-lazyload
source "${XDG_CONFIG_HOME}/zshrc/aliases.zsh"
source "${XDG_CONFIG_HOME}/zshrc/completions.zsh"
eval "$(ssh-agent)"
ssh-add {{ .chezmoi.homeDir }}/.ssh/id_ed25519
if [[ "$(command -v starship)" ]]; then
# starship prompt
eval "$(starship init zsh)"
fi
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && zi snippet "$HOME/.sdkman/bin/sdkman-init.sh"