문제

I changed from Mac Port to Homebrew

I am using zsh, I installed brew git git-extra and bash-completion. i still don't see git auto completion like mac ports used to show it.

도움이 되었습니까?

해결책 2

You need to add the configs to you .zshrc as below

zstyle ':completion:*:*:git:*' script
/usr/local/etc/bash_completion.d/git-completion.bash


fpath=(/usr/local/share/zsh/site-functions $fpath)

다른 팁

Seems like you need to get zsh-completions

Configuring Completions in zsh

To make Homebrew’s completions available in zsh, you must get the Homebrew-managed zsh site-functions on your FPATH before initialising zsh’s completion facility. Add the following to your ~/.zshrc file:

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

  autoload -Uz compinit
  compinit
fi

Additionally, if you receive “zsh compinit: insecure directories” warnings when attempting to load these completions, you may need to run this:

chmod -R go-w "$(brew --prefix)/share"

Source: https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top