From 9ae1c1aafaa07cb0e723e714f4fac348687ff810 Mon Sep 17 00:00:00 2001 From: Ishan Goel Date: Thu, 16 Jul 2020 14:21:15 +0400 Subject: [PATCH] Make Shell-Completion.md clearer and update it --- docs/Shell-Completion.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Shell-Completion.md b/docs/Shell-Completion.md index 4ae778f446..654fd31417 100644 --- a/docs/Shell-Completion.md +++ b/docs/Shell-Completion.md @@ -8,7 +8,7 @@ You must configure your shell to enable its completion support. This is because ## Configuring Completions in `bash` -To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.profile` file: +To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.profile` or `~/.bash_profile` file: ```sh if type brew &>/dev/null; then @@ -23,7 +23,8 @@ if type brew &>/dev/null; then fi ``` -Should you later install the `bash-completion` formula, this will automatically use its initialization script to read the completions files. +Should you later install the `bash-completion@2` formula, this will automatically use its initialization script to read the completions files. +When installed, the `bash-completion@2` formula also runs `${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh` and all files in the `bash_completion.d` directory (If the Caveats section is followed after installation, of course). Therefore, it is recommended to comment out the block of code given above after installing `bash-completion@2` because it becomes redundant. ## Configuring Completions in `zsh`