No need for special handling for zsh aliases
Zsh completion is native since v1.22. Native zsh completion automatically deals with aliases without needing any extra configuration from the user. Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
This commit is contained in:
parent
cfb4d2ab93
commit
0976014b7e
|
@ -12,16 +12,11 @@ To do so in all your shell sessions, add the following to your `~/.zshrc` file:
|
|||
source <(kubectl completion zsh)
|
||||
```
|
||||
|
||||
If you have an alias for kubectl, you can extend shell completion to work with that alias:
|
||||
|
||||
```zsh
|
||||
echo 'alias k=kubectl' >>~/.zshrc
|
||||
echo 'compdef __start_kubectl k' >>~/.zshrc
|
||||
```
|
||||
If you have an alias for kubectl, kubectl autocompletion will automatically work with it.
|
||||
|
||||
After reloading your shell, kubectl autocompletion should be working.
|
||||
|
||||
If you get an error like `complete:13: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
|
||||
If you get an error like `2: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
|
||||
|
||||
```zsh
|
||||
autoload -Uz compinit
|
||||
|
|
Loading…
Reference in New Issue