From b71644e7356395247776c19d3d89e42b2e60abb0 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Wed, 17 Nov 2021 14:27:15 -0500 Subject: [PATCH] Update Shell-Completion.md --- docs/Shell-Completion.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Shell-Completion.md b/docs/Shell-Completion.md index 0b06394e8b..07ffd3e1b1 100644 --- a/docs/Shell-Completion.md +++ b/docs/Shell-Completion.md @@ -4,7 +4,7 @@ Homebrew comes with completion definitions for the `brew` command. Some packages `zsh`, `bash` and `fish` are currently supported. -You must then configure your shell to enable its completion support. This is because the Homebrew-managed completions are stored under `HOMEBREW_PREFIX` which your system shell may not be aware of, and since it is difficult to automatically configure `bash` and `zsh` completions in a robust manner, the Homebrew installer does not do it for you. +You must manually configure your shell to enable its completion support. This is because the Homebrew-managed completions are stored under `HOMEBREW_PREFIX` which your system shell may not be aware of, and since it is difficult to automatically configure `bash` and `zsh` completions in a robust manner, the Homebrew installer does not do it for you. Shell completions for external Homebrew commands are not automatically installed. To opt-in to using completions for external commands (if provided), they need to be linked to `HOMEBREW_PREFIX` by running `brew completions link`. @@ -28,13 +28,13 @@ then fi ``` -If you install the `bash-completion` formula, this will automatically source the completions' initialisation script (so you do not need to follow the instructions in the caveats). +If you install the `bash-completion` formula, this will automatically source the completions' initialisation script (so you do not need to follow the instructions in the formula's caveats). -If you are using the `bash` formula as your shell (i.e. `bash` >= v4) you should use the `bash-completion@2` formula instead. +If you are using Homebrew's `bash` as your shell (i.e. `bash` >= v4) you should use the `bash-completion@2` formula instead. ## Configuring Completions in `zsh` -To make Homebrew's completions available in `zsh`, you must get the Homebrew-managed zsh site-functions on your `FPATH` before initialising `zsh`'s completion facility. Add the following to your `~/.zshrc` file: +To make Homebrew's completions available in `zsh`, you must insert the Homebrew-managed `zsh/site-functions` path into your `FPATH` before initialising `zsh`'s completion facility. Add the following to your `~/.zshrc`: ```sh if type brew &>/dev/null @@ -55,13 +55,13 @@ FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" You may also need to forcibly rebuild `zcompdump`: ```sh - rm -f ~/.zcompdump; compinit +rm -f ~/.zcompdump; compinit ``` Additionally, if you receive "zsh compinit: insecure directories" warnings when attempting to load these completions, you may need to run this: ```sh - chmod -R go-w "$(brew --prefix)/share" +chmod -R go-w "$(brew --prefix)/share" ``` ## Configuring Completions in `fish`