如何重新映射 zsh-autosuggestion 中的“tab”键以替换“tab”键

发布于 2025-01-11 21:59:42 字数 484 浏览 2 评论 0原文

zsh-autosuggestions 中,TAB 键接受建议,但然后还尝试提供更多建议,这与 fish-shell 的行为不同。
在fish中,如果您Tab,它会完成单词并且不会提供任何其他内容,直到您开始输入更多内容(即不会在空格上触发建议)。
在 zsh-autosuggestions 中,您只能使用 键来获得此行为。

那么我如何重新映射 使其表现得像 Tab (或者如何重新映射 Tab 使其表现得像 >)。

谢谢

In zsh-autosuggestions the TAB key accepts the suggestion but then also tries providing more suggestions, which is a difference in behaviour from fish-shell.

In fish if you Tab it completes the word and doesn't offer anything else until you start typing something more (ie suggestions aren't triggered on whitespace).

In zsh-autosuggestions, you can only get this behaviour by using the key.

So how can I remap the to behave like Tab (or alternatively how can I remap Tab to behave like ).

Thanks

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

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

发布评论

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

评论(1

扶醉桌前 2025-01-18 21:59:42

来自文档

bindkey '^ ' autosuggest-accept

我的设置,它绑定 ctrl+space 来接受然后执行建议:

bindkey '^ ' autosuggest-execute

from the docs:

bindkey '^ ' autosuggest-accept

my setting, which binds ctrl+space to accept then execute the suggestion:

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