1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/cli-configuring-completion-zsh.adoc

32 lines
830 B
Plaintext

// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/configuring-cli.adoc
:_mod-docs-content-type: PROCEDURE
[id="cli-enabling-tab-completion-zsh_{context}"]
= Enabling tab completion for Zsh
After you install the OpenShift CLI (`oc`), you can enable tab completion to automatically complete `oc` commands or suggest options when you press Tab. The following procedure enables tab completion for the Zsh shell.
.Prerequisites
* You must have the OpenShift CLI (`oc`) installed.
.Procedure
* To add tab completion for `oc` to your `.zshrc` file, run the following command:
+
[source,terminal]
----
$ cat >>~/.zshrc<<EOF
autoload -Uz compinit
compinit
if [ $commands[oc] ]; then
source <(oc completion zsh)
compdef _oc oc
fi
EOF
----
Tab completion is enabled when you open a new terminal.