-
Notifications
You must be signed in to change notification settings - Fork 0
Shell Completion
Omri Bornstein edited this page Oct 23, 2022
·
3 revisions
Please make sure you follow Homebrew’s documentation, which is mirrored below.
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 ~/.bash_profile:
for COMPLETION in "$(brew --prefix)/etc/bash_completion.d/"*; do
[[ -r "${COMPLETION}" ]] && source "${COMPLETION}"
done- Edit
~/.zshrcsuch thatFPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"is called beforeautoload -Uz compinit; compinitFPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" autoload -Uz compinit; compinit
- In my case, the following configuration worked the best, since other tools (such as
vagrant) keep the completions in other places:FPATH="$(brew --prefix)/share/zsh/site-functions:$(brew --prefix)/share/zsh-completions:${FPATH}" autoload -Uz compinit; compinit
- You may also need to forcibly rebuild
zcompdump:rm -f ~/.zcompdump; compinit
- Additionally, if you receive
zsh compinit: insecure directorieswarnings when attempting to load these completions, you may need to run this:chmod -R go-w "$(brew --prefix)/share"