Repository navigation
Expand file tree
/
Copy pathdot_zshrc
More file actions
72 lines (59 loc) · 2.92 KB
/
Copy pathdot_zshrc
File metadata and controls
72 lines (59 loc) · 2.92 KB
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
source "${HOME}/.exports"
source "${HOME}/.functions"
# Homebrew goes first, because `brew shellenv` prepends its own bin and sbin.
# Naming the shell avoids forking `ps` to guess it, and only the zsh reply puts
# Homebrew's completions on fpath.
if [[ -x "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
elif [[ -x "/usr/local/bin/brew" ]]; then
eval "$(/usr/local/bin/brew shellenv zsh)"
fi
# Each is prepended, so the last one wins. Coursier is appended so its launchers
# never shadow a binary from Homebrew or mise.
path:add "$HOME/.local/bin"
path:add "$HOME/.cargo/bin"
path:add "$HOME/.console-ninja/.bin"
path:add "/Library/Frameworks/Python.framework/Versions/Current/bin"
path:add "$HOME/Library/Application Support/JetBrains/Toolbox/scripts"
path:append "$HOME/Library/Application Support/Coursier/bin"
path:append ${(s.:.)PATH_ADD}
# After the PATH setup, so startup code finds the managed tools, and before
# plugins:load, whose background completion jobs (codex's, for one) would
# otherwise go through the slower shims. That costs more than the one extra
# `mise hook-env` the composer plugin's later PATH append causes.
cmd:exists mise && eval "$(mise activate zsh)"
# The aws plugin's RPROMPT segment prints literally, because antidote skips the
# oh-my-zsh.sh that sets prompt_subst
SHOW_AWS_PROMPT=false
# A shell that inherits EDITOR=vi, such as `reload`, would start in vi insert
# mode. /etc/zshrc has already bound these keys into that keymap.
bindkey -e
[[ -n ${key[Delete]} ]] && bindkey -- "${key[Delete]}" delete-char
[[ -n ${key[Home]} ]] && bindkey -- "${key[Home]}" beginning-of-line
[[ -n ${key[End]} ]] && bindkey -- "${key[End]}" end-of-line
# This runs before .aliases, which is the authority on any name both define
plugins:load
source "${HOME}/.aliases"
source "${HOME}/.completions"
# Figxit ranks by Atuin's history. Suggestions stay on zsh history, because
# Atuin's strategy runs a search process on every keypress.
if cmd:exists atuin; then
eval "$(atuin init zsh --disable-up-arrow --disable-ai)"
ZSH_AUTOSUGGEST_STRATEGY=(history)
fi
# Figxit lowers an untouched KEYTIMEOUT of 40 to 5, which leaves 50 ms for sudo's
# Esc Esc. Its Enter, Up and Down fall back to accept-line and history search, so
# they clear the suggestion as those do, instead of drawing it back onto the line
# that just ran. Esc closes its list, and a Tab within KEYTIMEOUT would otherwise
# read as Esc-Tab, which inserts a literal tab.
if [[ -x "/Applications/Figxit.app/Contents/MacOS/figxit-engine" ]]; then
KEYTIMEOUT=30
bindkey -r '^[^I'
eval "$(/Applications/Figxit.app/Contents/MacOS/figxit-engine init zsh)"
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(figxit-enter figxit-up figxit-down)
fi
[[ "${AUTOSTART_SSH_AGENT}" == "true" ]] && ssh:agent
runaway:alerts
cmd:exists mise && run:daily mise mise:update
cmd:exists brew && run:daily brew brew:check
[[ -f "${HOME}/.plugins" ]] && run:daily plugins plugins:update