如何限制 zsh 将自动完成(使用制表符)的 git 命令子集?

发布于 2024-08-23 15:03:45 字数 286 浏览 4 评论 0原文

我有以下组合:

autoload -Uz compinit
compinit

autoload -Uz vcs_info

实际上允许 git 和 zsh 的选项卡补全之间进行大量集成。事实上太多了。如何限制命令集,以便 git che(TAB) 将扩展为 checkout,而不是在 checkout结账索引

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花开雨落又逢春i 2024-08-30 15:03:45

您没有太多的精细控制,但这应该可行:

zstyle ':completion:*:*:git:*' commands base

但是,这可能依赖于最近对 _git 补全的修复(特别是引用修复),因此您可能希望从 CVS 获取最新的 _git 定义(或本地 git 镜像):

http://zsh.cvs .sourceforge.net/viewvc/zsh/zsh/Completion/Unix/Command/_git

“命令”后的可用单词:所有基本附加有用的互操作性辅助内部

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文