Zsh
zsh完成brew公式
在 OS X 中,有沒有辦法讓 Zsh (我正在使用Oh-my-zsh)製表符完成公式?
例如
$ brew install em<TAB>
可以擴展為:
$ brew install emacs
Homebrew 提供了它自己的完成。您只需要將文件連結
$(brew --prefix)/Library/Contributions/brew_zsh_completion.zsh
到_brew
您的.(請參閱https://github.com/Homebrew/homebrew/blob/master/Library/Contributions/brew_zsh_completion.zsh$fpath
開頭的評論)
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
公式結合使用。