From 11eba27f0faf9f887d8aae470ef0341f942932be Mon Sep 17 00:00:00 2001 From: Shmuel Raichman <22668282+shmuel-raichman@users.noreply.github.com> Date: Tue, 12 Jul 2022 19:28:29 +0300 Subject: [PATCH] Changed - kubectl added support for zsh --- Examples.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Examples.md b/Examples.md index a4a09ca..3bd3c19 100644 --- a/Examples.md +++ b/Examples.md @@ -936,13 +936,20 @@ bind-key -n 'M-`' run "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$ ### kubectl Add support for kubectl completion with fzf ```bash +# BASH # Tested kubectl version `v1.23.6` # Make all kubectl completion fzf command -v fzf >/dev/null 2>&1 && { - source <(kubectl completion bash | sed 's#"${requestComp}" 2>/dev/null#"${requestComp}" 2>/dev/null | head -n -1 | fzf --multi=0 #g') # setup autocomplete for istioctl + source <(kubectl completion bash | sed 's#"${requestComp}" 2>/dev/null#"${requestComp}" 2>/dev/null | head -n -1 | fzf --multi=0 #g') +} + +# ZSH +# Make all kubectl completion fzf +command -v fzf >/dev/null 2>&1 && { + source <(kubectl completion zsh | sed 's#${requestComp} 2>/dev/null#${requestComp} 2>/dev/null | head -n -1 | fzf --multi=0 #g') } ``` -Put this in your `.bashrc` insted of +Put this in your `.bashrc` or `.zshrc` instead of: ```bash source <(kubectl completion bash) ``` @@ -963,6 +970,7 @@ This was tested with (should work with all commands): - [x] version `v1.23.6` - [x] bash +- [x] zsh - commands: - [x] get - [x] get pods