-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot-zshrc
179 lines (147 loc) · 4.43 KB
/
dot-zshrc
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
## Uncomment to profile
# zmodload zsh/zprof
# Enable Powerlevel10k instant prompt.
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
# Zinit
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
source "${ZINIT_HOME}/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
## Plugins
zinit ice depth=1; zinit light romkatv/powerlevel10k
zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-completions
zinit light zsh-users/zsh-autosuggestions
# Snippets
zinit snippet OMZP::brew
zinit snippet OMZP::colored-man-pages
zinit snippet OMZP::common-aliases
zinit snippet OMZP::docker
zinit snippet OMZP::docker-compose
zinit snippet OMZP::extract
zinit snippet OMZP::gh
zinit snippet OMZP::git
zinit snippet OMZP::pip
zinit snippet OMZP::tmux
zinit snippet OMZP::command-not-found
zinit snippet OMZP::eza
# Plugins from oh-my-zsh
zinit wait'2' lucid for OMZL::clipboard.zsh
dir="$HOME/.zsh-complete"
mkdir -p "$dir"
rg --generate complete-zsh > "$dir/_rg"
# Load completions
autoload -U compinit && compinit
zinit cdreplay -q
## Keybindings
bindkey -e
bindkey '^p' history-search-backward
bindkey '^n' history-search-forward
bindkey '^[[Z' reverse-menu-complete
# History
export HISTIGNORE="&:ls:ll:l:cd:[bf]g:exit:pwd:clear:mount:umount:[ \t]*"
export HISTFILESIZE=1000000000
export HISTSIZE=1000000000
export SAVEHIST=$HISTSIZE
export HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
export LS_COLORS="$(vivid generate snazzy)"
export EXA_COLORS="da=1;34:uu=35:gu=35"
# Completion styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu select
zstyle ':completion:*' file-sort modification
# Disable some zsh weirdness
unsetopt autocd
unsetopt beep
unsetopt nomatch
# set language
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
## Tools
# atuin (SQLite-backed shell command history)
eval "$(atuin init zsh --disable-ctrl-r --disable-up-arrow)"
# FZF Integration
eval "$(fzf --zsh)"
# Zoxide
eval "$(zoxide init --cmd cd zsh)"
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv virtualenvwrapper
# pipx
export PATH="$PATH:$HOME/.local/bin"
export PIPX_DEFAULT_PYTHON="$(pyenv shell 3.11.2; pyenv which python)"
# invenio-cli
eval "$(_INVENIO_CLI_COMPLETE=source_zsh invenio-cli)"
# uv completions
eval "$(uv generate-shell-completion zsh)"
# ruff completions
eval "$(ruff generate-shell-completion zsh)"
# psql and pg_* commands
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
# iterm2 shell integration
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" || true
# direnv
eval "$(direnv hook zsh)"
# doggo completions
doggo completions zsh > "${fpath[1]}/_doggo"
# ruby...
rbenv() {
eval "$(rbenv init - --no-rehash zsh)"
}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# broot integration
source "$HOME/.config/broot/launcher/bash/br"
# gh completion
gh completion --shell zsh >| "$ZSH_CACHE_DIR/completions/_gh" &|
eval "$(gh copilot alias -- zsh)"
# oc (OpenShift)
source <(oc completion zsh)
# nvm (lazy load)
NODE_GLOBALS=(`find $NVM_DIR/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`)
NODE_GLOBALS+=("node")
NODE_GLOBALS+=("nvm")
# Lazy-loading nvm + npm on node globals
load_nvm () {
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
}
# Making node global trigger the lazy loading
for cmd in "${NODE_GLOBALS[@]}"; do
eval "${cmd}(){ unset -f ${cmd} >/dev/null 2>&1; load_nvm; ${cmd} \$@; }"
done
# bun completions
source "$HOME/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# Go binaries
export PATH="$HOME/go/bin:$PATH"
. "$HOME/.cargo/env"
# pnpm
export PNPM_HOME="$HOME/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# ImageMagick
export MAGICK_HOME=/opt/homebrew/opt/imagemagick/
export PATH="/opt/homebrew/opt/imagemagick/bin:$PATH"
## Aliases
source $HOME/.zsh_aliases
# powerlevel10k init (MUST be at the end!)
source ~/.p10k.zsh
## Uncomment to profile
# zprof