File tree Expand file tree Collapse file tree 3 files changed +40
-8
lines changed
Expand file tree Collapse file tree 3 files changed +40
-8
lines changed Original file line number Diff line number Diff 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)
66export EDITOR=$( which nvim)
77export XDG_CONFIG_HOME=$HOME /dotfiles
88if command -v launchctl > /dev/null 2>&1 ; then
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ atuin_init() {
5454
5555fpath=($HOME /dotfiles/zsh/custom-autocomplete/ $fpath )
5656autoload -U compinit
57- compinit
57+ # Use cached completion dump for faster loading (skip security check)
58+ compinit -C
5859autoload -Uz $HOME /dotfiles/zsh/custom-autocomplete/todo
5960
6061export HISTFILE=~ /.zsh_history
@@ -78,9 +79,33 @@ pyenv_init
7879starship_init
7980flyctl_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+
82101eval " $( 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
86111pretzo_init
Original file line number Diff line number Diff 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+
712eval " $( /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
You can’t perform that action at this time.
0 commit comments