Add support for kubectl and k3s

Commit 17ff1b8dfb36 · Ahmad Khayyat · 2026-06-21 07:44 +0300

Changeset
17ff1b8dfb3686c756a6ed2b19d0e877b65db7e9

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/zsh/completion.zsh b/zsh/completion.zsh
--- a/zsh/completion.zsh
+++ b/zsh/completion.zsh
@@ -136,3 +136,11 @@
 highlights='${PREFIX:+=(#bi)($PREFIX:t)(?)*==31=1;32}':${(s.:.)LS_COLORS}}
 zstyle -e ':completion:*' list-colors 'if [[ $words[1] != kill && $words[1] != strace ]]; then reply=( "'$highlights'" ); fi'
 unset highlights
+
+# k3s
+if [ -x "$(which k3s)" ]; then
+    . <(k3s completion zsh)
+fi
+if [ -x "$(which kubectl)" ]; then
+    . <(kubectl completion zsh)
+fi
diff --git a/zsh/programs.zsh b/zsh/programs.zsh
--- a/zsh/programs.zsh
+++ b/zsh/programs.zsh
@@ -71,3 +71,8 @@
 if [ -r ~/.config/broot/launcher/bash/br ]; then
     source ~/.config/broot/launcher/bash/br
 fi
+
+# kubectl
+if [ -r ~/.kube/config ]; then
+    export KUBECONFIG=~/.kube/config
+fi