Optimize zsh startup time (~10x faster)
- Add compinit caching (regenerate daily instead of every shell) - Set skip_global_compinit to avoid double initialization - Remove kubectl from oh-my-zsh plugins - Add lazy-loading for kubectl completions - Add common kubectl aliases (k, kgp, kgs, kgn, etc.) Startup time: 1.55s → 0.15s
This commit is contained in:
parent
add7e7c756
commit
cfd4357880
2 changed files with 31 additions and 6 deletions
15
dot_zshrc
15
dot_zshrc
|
|
@ -1,3 +1,13 @@
|
|||
# ============================================================================
|
||||
# Fast compinit - cache completions, regenerate once daily
|
||||
# ============================================================================
|
||||
autoload -Uz compinit
|
||||
if [[ -n ${ZDOTDIR:-$HOME}/.zcompdump(#qN.mh+24) ]]; then
|
||||
compinit
|
||||
else
|
||||
compinit -C
|
||||
fi
|
||||
|
||||
# ~/.zshrc - Zsh configuration for interactive shells
|
||||
# Customizations are in ~/.oh-my-zsh/custom/*.zsh (auto-loaded)
|
||||
|
||||
|
|
@ -39,10 +49,13 @@ plugins=(
|
|||
git
|
||||
encode64
|
||||
gitignore
|
||||
kubectl
|
||||
z
|
||||
)
|
||||
|
||||
# Skip compinit in oh-my-zsh (we handle it above)
|
||||
export ZSH_DISABLE_COMPFIX=true
|
||||
skip_global_compinit=1
|
||||
|
||||
# ============================================================================
|
||||
# Load Oh-My-Zsh
|
||||
# ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue