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
334bd02dca
commit
b2b7c7db45
2 changed files with 31 additions and 6 deletions
|
|
@ -1,6 +1,18 @@
|
|||
# Kubectl configuration
|
||||
# Auto-loaded by oh-my-zsh from $ZSH_CUSTOM/tools/
|
||||
# Note: Completions are handled by the kubectl plugin in .zshrc
|
||||
# Lazy-load kubectl completions (saves ~100ms startup time)
|
||||
if (( $+commands[kubectl] )); then
|
||||
function kubectl() {
|
||||
unfunction kubectl
|
||||
source <(command kubectl completion zsh)
|
||||
kubectl "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
# Load golang path if exists
|
||||
[[ -f /etc/profile.d/golang_path.sh ]] && source /etc/profile.d/golang_path.sh
|
||||
# Aliases (available immediately)
|
||||
alias k='kubectl'
|
||||
alias kgp='kubectl get pods'
|
||||
alias kgs='kubectl get svc'
|
||||
alias kgn='kubectl get nodes'
|
||||
alias kga='kubectl get all'
|
||||
alias kd='kubectl describe'
|
||||
alias kl='kubectl logs'
|
||||
alias kx='kubectl exec -it'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue