Skip to content

Commit f9664ab

Browse files
committed
feat
1 parent bd179c6 commit f9664ab

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

dotfiles/common/.zshenv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ bash $HOME/dotfiles/scripts/trace.sh "$0"
22
# if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
33
# . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
44
# fi
5-
eval "$(mise activate zsh)"
5+
# Moved mise activation to .zshrc for interactive shells only (performance optimization)
66
export EDITOR=$(which nvim)
77
export XDG_CONFIG_HOME=$HOME/dotfiles
88
if command -v launchctl >/dev/null 2>&1; then

dotfiles/common/.zshrc

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ atuin_init() {
5454

5555
fpath=($HOME/dotfiles/zsh/custom-autocomplete/ $fpath)
5656
autoload -U compinit
57-
compinit
57+
# Use cached completion dump for faster loading (skip security check)
58+
compinit -C
5859
autoload -Uz $HOME/dotfiles/zsh/custom-autocomplete/todo
5960

6061
export HISTFILE=~/.zsh_history
@@ -78,9 +79,33 @@ pyenv_init
7879
starship_init
7980
flyctl_init
8081

81-
eval "$(zoxide init zsh)"
82+
# Lazy-load mise for faster startup (only initialize on first use)
83+
mise() {
84+
unfunction mise
85+
eval "$(command mise activate zsh)"
86+
mise "$@"
87+
}
88+
89+
# Lazy-load zoxide (only initialize on first use of z/zi commands)
90+
z() {
91+
unfunction z zi 2>/dev/null
92+
eval "$(zoxide init zsh)"
93+
z "$@"
94+
}
95+
zi() {
96+
unfunction z zi 2>/dev/null
97+
eval "$(zoxide init zsh)"
98+
zi "$@"
99+
}
100+
82101
eval "$(ssh-agent)" &>/dev/null &>/dev/null
83-
eval "$(direnv hook zsh)"
102+
103+
# Lazy-load direnv (only initialize on first cd)
104+
direnv() {
105+
unfunction direnv
106+
eval "$(command direnv hook zsh)"
107+
direnv "$@"
108+
}
84109

85110
# done twice for a reason
86111
pretzo_init

dotfiles/macos/.zshrc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ export DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib
33
# eval "$(gh copilot alias -- zsh)"
44
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
55
. "$HOME/.local/bin/env"
6-
eval "$(keychain --eval --quiet --agents ssh ~/.ssh/github-air ~/.ssh/macbook-pro)"
6+
7+
# Cache keychain eval to avoid subprocess on every startup
8+
if [ -z "$SSH_AUTH_SOCK" ]; then
9+
eval "$(keychain --eval --quiet --agents ssh ~/.ssh/github-air ~/.ssh/macbook-pro)"
10+
fi
11+
712
eval "$(/opt/homebrew/bin/brew shellenv)"
8-
quote
9-
echo ""
10-
quote
13+
14+
# Skip quote display for faster startup (can be called manually with 'quote' command)
15+
# quote
16+
# echo ""
17+
# quote

0 commit comments

Comments
 (0)