Answers:
Homebrew提供它自己的完成。您只需要将文件链接$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh
到_brew
您的某个位置即可$fpath
。(请参阅https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh开头的评论)
zsh-completions
最近_brew
为了支持该文件而删除了它的完成信息,请参阅https://github.com/zsh-users/zsh-completions/issues/305。
2016年4月19日更新:在某个时候(1)Homebrew再次更新了其对zsh完成的处理。现在,如果通过Homebrew 安装zsh,它将“正常工作”。该文件已安装到/usr/local/share/zsh/site-functions/_brew
。
尝试安装zsh-completions
公式。
$ brew info zsh-completions
zsh-completions: stable 0.10.0, HEAD
https://github.com/zsh-users/zsh-completions
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/zsh-completions.rb
==> Caveats
To activate these completions, add the following to your .zshrc:
fpath=(/usr/local/share/zsh-completions $fpath)
You may also need to force rebuild `zcompdump`:
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:
chmod go-w /usr/local/share
看起来zsh可能与bash补全兼容。您可以将其与bash-completions
公式结合使用。
compinit -i
应该解决“不安全目录”警告而不是chmod。
compaudit
确定应更改其权限的目录
$fpath
并愿意在其中$FPATH
容纳这些新完成功能的人员Zsh
,本问答可能会提供很多信息。