一些与鱼的自动完成相关的问题shell

Some questions related the autocompletion of the fish shell

在鱼中键入命令的开头时 shell 最近(或经常?)可能完成的命令以深灰色显示。

假设我输入:

fish

深灰色:附加 _config

目前还不清楚我要做什么。所以 TAB 键显示了 'fish'

的所有可能完成

我可以继续输入字符,直到清楚我想要什么为止。例如:_con

现在只有一个选项可以完成。所以我可以按 Tab 键查看 fish_config。但是:这并没有以某种方式表明。换句话说:在输入 fish_con 之后,没有什么真正告诉我我不必继续输入。是这样吗?这不是很有帮助吗?

第二问:灰字的实际意义是什么?如果有办法接受这个提议,我只会理解他们的目的。在键入 f 后,我希望有一个组合键可以立即完全完成灰色的提议:fish_config.

更好的办法是让灰色字母循环显示所有选项,或者根据历史记录可能完成的选项。

光标右边的字符称为自动提示。它们是灰色的,表示它们实际上不是命令的一部分,只是建议完成您目前输入的内容。

So I can hit the tab key to see fish_config. However: this was not indicated somehow. In other words: After typing fish_con nothing really tells me that I don't have to keep on typing

当部分命令是另一个命令的唯一前缀时,这听起来像是您有一个指示的想法。我不确定 UI 你在想什么 - 指示会是什么样子?欢迎来到 open an issue,提出您的 UI 个想法。

但是,如果您的命令是唯一的,自动建议将始终包含它。

Second question: What is the actual sense of the grey characters? I'd only understand their purpose if there was a way to accept this propose. After typing f, I'd expect a key combination that immediately fully completes to the propose in grey: fish_config.

您可以通过按向右箭头或 control-F 来接受自动建议。 Tab 显示所有可能的完成,向上箭头让您循环浏览匹配历史记录。

您可能想阅读鱼教程,其中涵盖了此处的自动建议:http://fishshell.com/docs/current/tutorial.html#tut_autosuggestions