Skip to content

Commit

Permalink
Update: Using universal zsh configuration (#5669)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ariestiyansyah authored and steveperry-53 committed Oct 26, 2017
1 parent 4cd832b commit 6713555
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/tasks/tools/install-kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### 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
source <(kubectl completion zsh)
Expand Down

0 comments on commit 6713555

Please sign in to comment.