From 0976014b7e894dd9be97a655c23c51a70c09ecdd Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 4 Mar 2022 13:51:42 -0500 Subject: [PATCH] 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 --- .../tasks/tools/included/optional-kubectl-configs-zsh.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/content/en/docs/tasks/tools/included/optional-kubectl-configs-zsh.md b/content/en/docs/tasks/tools/included/optional-kubectl-configs-zsh.md index b7d9044605..176bdeeeb1 100644 --- a/content/en/docs/tasks/tools/included/optional-kubectl-configs-zsh.md +++ b/content/en/docs/tasks/tools/included/optional-kubectl-configs-zsh.md @@ -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