Git选项卡完成在Mac上的zsh中不起作用 [英] Git tab completion not working in zsh on mac
问题描述
无论我尝试什么,我似乎都无法在我的zsh shell中使git tab/autocomplete工作.我已经下载了bash-completion脚本和zsh-completion脚本,并按照说明进行了操作,但是我无法使其工作.
No matter what I try and do I can't seem to make git tab/auto completion work in my zsh shell. I've downloaded the bash-completion script and the zsh-completion one and followed the instructions, but I can't make it work.
我已经重新安装了oh-my-zsh,但这似乎没有帮助或没有任何作用.
I've reinstalled oh-my-zsh but that didn't seem to help or make any difference.
任何能够使它工作的人都可以向我描述他们的设置,以便我可以尝试进行仿真以使其对我有用吗?
Can anyone who's got it working describe to me their setup so I can try an emulate it to get it working for me?
具体来说,到目前为止我所做的是:
To be specific, what I've done so far is:
- 切换为使用zsh作为我的默认外壳程序
- 安装了oh-my-zsh
- 下载了 https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 并将其保存在
~/.completion/git/git-completion.sh
中
- 下载了 https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh 并将其保存在
~/.zsh/_git
中
- 添加了
zstyle ':completion:*:*:git:*' script ~/.completion/git/git-completion.sh
- Switched to using zsh as my default shell
- Installed oh-my-zsh
- Downloaded https://github.com/git/git/blob/master/contrib/completion/git-completion.bash and saved it in
~/.completion/git/git-completion.sh
- Downloaded https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh and saved that in
~/.zsh/_git
- Added
zstyle ':completion:*:*:git:*' script ~/.completion/git/git-completion.sh
没有运气.
推荐答案
答案是我的.zshrc
文件中有alias git=hub
.请参阅 https://github.com/github/hub 以获取有关中心的信息(很棒).
The answer was that I had alias git=hub
in my .zshrc
file. See https://github.com/github/hub for info on hub (it's awesome).
以下是有关我在使用hub和git完成时遇到的问题的信息的链接: https://github.com/github/hub/issues/586#issuecomment-47727226
Here's a link to info about the problem I was having with hub and git completion: https://github.com/github/hub/issues/586#issuecomment-47727226
这篇关于Git选项卡完成在Mac上的zsh中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!