Skip to content

Commit 6b2766d

Browse files
schroedercphilwo
authored andcommitted
Add zsh completion script
Fixes #163 -- MOS_MIGRATED_REVID=95542929
1 parent a01b9fe commit 6b2766d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

site/docs/install.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ $ export PATH="$PATH:$HOME/bazel/output"
134134

135135
You can also add this command to your `~/.bashrc` file.
136136

137-
## Getting bash completion
137+
### Getting bash completion
138138

139139
Bazel comes with a bash completion script. To install it:
140140

@@ -145,4 +145,25 @@ Bazel comes with a bash completion script. To install it:
145145
you and simply insert `source /path/to/bazel-complete.bash` in your
146146
`~/.bashrc` file (under OS X, put it in your `~/.bash_profile` file).
147147

148+
### Getting zsh completion
149+
150+
Bazel also comes with a zsh completion script. To install it:
151+
152+
1. Add this script to a directory on your $fpath:
153+
154+
```
155+
fpath[1,0]=~/.zsh/completion/
156+
mkdir -p ~/.zsh/completion/
157+
cp scripts/zsh_completion/_bazel ~/.zsh/completion
158+
```
159+
160+
2. Optionally, add the following to your .zshrc.
161+
162+
```
163+
# This way the completion script does not have to parse Bazel's options
164+
# repeatedly. The directory in cache-path must be created manually.
165+
zstyle ':completion:*' use-cache on
166+
zstyle ':completion:*' cache-path ~/.zsh/cache
167+
```
168+
148169
For more information, see [Getting started](getting-started.html).

0 commit comments

Comments
 (0)