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/bazel
wget -P ~/.oh-my-zsh/plugins https://raw.githubusercontent.com/bazelbuild/bazel/master/scripts/zsh_completion/_bazel
- Add
bazel
to the plugins list in your~/.zshrc
plugins=(git autojump colored-man-pages bazel)
- Restart zsh:
zsh