m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 07:43:39 -05:00

Changed - kubectl added support for zsh

Shmuel Raichman
2022-07-12 19:28:29 +03:00
parent 7b2760d0b0
commit 11eba27f0f

@@ -936,13 +936,20 @@ bind-key -n 'M-`' run "tmux split-window -p 40 'tmux send-keys -t #{pane_id} \"$
### kubectl ### kubectl
Add support for kubectl completion with fzf Add support for kubectl completion with fzf
```bash ```bash
# BASH
# Tested kubectl version `v1.23.6` # Tested kubectl version `v1.23.6`
# Make all kubectl completion fzf # Make all kubectl completion fzf
command -v fzf >/dev/null 2>&1 && { 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 ```bash
source <(kubectl completion bash) source <(kubectl completion bash)
``` ```
@@ -963,6 +970,7 @@ This was tested with (should work with all commands):
- [x] version `v1.23.6` - [x] version `v1.23.6`
- [x] bash - [x] bash
- [x] zsh
- commands: - commands:
- [x] get - [x] get
- [x] get pods - [x] get pods