how to install kubectl autocompletion plugin for zsh?
Asked Answered
E

2

6

I installed ohmyz.sh , on my mac book , i want to install kubectl autocompletion plugin for zsh , but not aware of the steps to install , can any one help on this please ?

Extensible answered 20/2, 2018 at 6:29 Comment(0)
J
10

Another option: I like having the following setup;

~/.zshrc: define which plugins I want to load

...

plugins=(
  git
  ...
  kubectl
)

...

~/.oh-my-zsh/custom/plugins/*: define my custom plugins, in this case override the kubectl from OhMyZsh with the file that this command generates:

kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl.plugin.zsh

working setup

Julesjuley answered 30/4, 2019 at 10:59 Comment(0)
A
7

According to official kubectl documentation:

when using Oh-My-Zsh, edit the ~/.zshrc file and update the plugins= line to include the kubectl plugin.

source <(kubectl completion zsh)
Advisedly answered 20/2, 2018 at 10:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.