Install Zsh completions
mainTo install completions for Z shell, follow the method corresponding to your setup:
With oh-my-zsh
Copy the generated script to your .oh-my-zsh/completions directory. The filename must follow the format _<command_name> (e.g., _example).
$ example --generate-completion-script zsh > ~/.oh-my-zsh/completions/_exampleWithout oh-my-zsh
- Add a completion directory to your
fpathand enable autoloading in~/.zshrc:
fpath=(~/.zsh/completion $fpath)
autoload -U compinit
compinit- Create the directory
~/.zsh/completion. - Copy the generated script into that directory.