Move kubernetes commands to partial

This commit is contained in:
Paweł Płazieński 2024-02-27 21:03:43 +01:00
parent c391bf9589
commit 5b90d759d5
2 changed files with 13 additions and 18 deletions

13
zsh.d/kubernetes.zsh Normal file
View File

@ -0,0 +1,13 @@
if command-exists "kubectl"; then
source <(kubectl completion zsh)
fi
if command-exists "k3s"; then
source <(k3s completion zsh)
fi
if command-exists "minikube"; then
source <(minikube completion zsh)
fi

18
zshrc
View File

@ -368,24 +368,6 @@ store_last_return_value() {
# This must be exactly first precmd function, because other precmd might modify $?
precmd_functions=(store_last_return_value $precmd_functions)
# If kubectl is present, load completions from it.
# This must be done after compinit was called
if [[ $commands[kubectl] ]]; then
source <(kubectl completion zsh)
fi
# If k3s is present, load completions from it.
# This must be done after compinit was called
if [[ $commands[k3s] ]]; then
source <(k3s completion zsh)
fi
# If minikube is present, load completions from it.
# This must be done after compinit was called
if [[ $commands[minikube] ]]; then
source <(minikube completion zsh)
fi
zmodload zsh/complist
#---------------------------------- Partials ------------------------------------