Improve zsh startup time

80cfa5e2e0f70988328539de799d88d794d064f8
Alexis Sellier committed ago 1 parent 047dd8bb
.zshrc +7 -3
17 17
# Fzy integration
18 18
if command -v fzy >/dev/null 2>&1 && test -f ~/.fzy.zsh; then
19 19
  source ~/.fzy.zsh
20 20
fi
21 21
22 -
if command -v kubectl >/dev/null 2>&1; then
23 -
	source <(kubectl completion zsh)
24 -
fi
22 +
# K8 integration. We lazy load because it's slow otherwise.
23 +
function kubectl() {
24 +
	if ! type __start_kubectl >/dev/null 2>&1; then
25 +
		source <(kubectl completion zsh)
26 +
	fi
27 +
	command kubectl "$@"
28 +
}
25 29
26 30
# Fzy history search doesn't sort things in a useful way, so we use zsh for now.
27 31
bindkey '^R' history-incremental-search-backward
28 32
29 33
#