How to limit the subset of git commands that zsh will auto-complete (with tab)?
-
23-09-2019 - |
문제
I have a combination of:
autoload -Uz compinit
compinit
and
autoload -Uz vcs_info
It actually allows for a great amount of integration between git and zsh's tab completion. Too much in fact. How do I limit the set of commands, so that git che(TAB)
will expand to checkout
, and not to a choice between checkout
and checkout-index
?
해결책
You don't have a lot of fine control, but this should work:
zstyle ':completion:*:*:git:*' commands base
However, this may rely upon recent fixes to the _git completion (in particular, a quoting fix) so you might want to grab the latest _git definition from CVS (or local git mirror):
http://zsh.cvs.sourceforge.net/viewvc/zsh/zsh/Completion/Unix/Command/_git
Available words to go after 'commands': all base additional useful interoperability ancillary internal
제휴하지 않습니다 StackOverflow