<shell>
is one of bash
, zsh
or fish
.
If you get permission denied error, you can try running the following command:
The correct method of installing a completion script can depend on both your
shell and your configuration.
Installation
Completions typically will be installed automatically by your shell’s package manager and the script will try to install them.Zsh
This example shows how to enable tab completion for zsh, it assumes you are usingoh-my-zsh
.
Your completion script must have the name in the format of _ followed by the
name of the application.
oh-my-zsh
, you will need to add a path for completion scripts to your
function path, and turn on completion script autoloading. First, add these lines
to ~/.zshrc
:
~/.zsh/completion
and copy the completion script
to the new directory.
Bash
If you have bash-completion installed, you can just copy your new completion script to the/usr/local/etc/bash_completion.d
or /usr/share/bash-completion/completions
directory using the following command:
~/.bash_completions/
, and then add the
following line to ~/.bash_profile
or ~/.bashrc
:
Fish
To enable tab completion for fish, copy the completion script to the~/.config/fish/completions
or /usr/share/fish/completions
directory using
the following command: