Update: Using universal zsh configuration (#5669)
* Update install-kubectl.md Zsh is not only oh-my-zsh, so I added universal configuration for zsh that also can be used in prezto. * fix merge error after rebase
This commit is contained in:
committed by
zacharysarah
parent
08f98d070c
commit
7b48c52d26
@@ -187,10 +187,17 @@ kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
|
|||||||
|
|
||||||
The Homebrew project is independent from Kubernetes, so the bash-completion packages are not guaranteed to work.
|
The Homebrew project is independent from Kubernetes, so the bash-completion packages are not guaranteed to work.
|
||||||
|
|
||||||
### Using zsh
|
### Using Zsh
|
||||||
|
If you are using zsh edit the ~/.zshrc file and add the following code to enable kubectl autocompletion:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
if [ $commands[kubectl] ]; then
|
||||||
|
source <(kubectl completion zsh)
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
Or when using [Oh-My-Zsh](http://ohmyz.sh/), edit the ~/.zshrc file and update the `plugins=` line to include the kubectl plugin.
|
||||||
|
|
||||||
To add kubectl autocompletion to your ZSH profile, add the following line to
|
|
||||||
the ~/.zshrc file:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
source <(kubectl completion zsh)
|
source <(kubectl completion zsh)
|
||||||
|
|||||||
Reference in New Issue
Block a user