To get Bazel command and target auto-completion in zsh with oh-my-zsh, the offical zsh script as plugin:
mkdir -p ~/.oh-my-zsh/plugins/bazelwget -P ~/.oh-my-zsh/plugins https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel- Add
bazelto the plugins list in your~/.zshrc
plugins=(git autojump colored-man-pages bazel)- Restart zsh:
zsh
curl -o ~/.oh-my-zsh/plugins https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel