~/.zshrc配置文件里面添加如下代码:

if type brew &>/dev/null; then
  FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH

  autoload -Uz compinit
  compinit
fi

如果是使用了Oh My Zsh,则需要在调用oh-my-zsh.sh之前执行。

Related Posts