使用 bash tab-completion 忽略路径条目

发布于 2024-08-20 12:55:06 字数 454 浏览 4 评论 0原文

我有两个命令,foofoo-bar,其中 foofoo-bar 的符号链接。我希望能够输入 f+TAB (假设这是路径上以 f 开头的唯一两个命令)并完成其中一个(意味着全名后面的空格)。

但最终发生的情况是,由于 foo-bar,它只完成了 foo (没有空格)。显然,只需按空格键并不需要太多工作,但这会打断我的流程。

一些其他详细信息:

  • foofoo-bar 位于同一目录中。
  • 删除/移动 foo 不是一个选项(我隐藏了一些细节)。

有没有办法忽略特定的路径条目?

I have two commands, foo and foo-bar, where foo is a symlink to foo-bar. I want to be able to type f+TAB (pretend these are the only two commands on the path that begin with f) and have one of them be completed (meaning the full name and the space after).

What ends up happening though is that it completes to just foo (no space) because of foo-bar. It's obviously not much work to then just hit the space bar, but this interrupts my flow.

Some additional details:

  • foo and foo-bar are in the same directory.
  • Deleting/moving foo isn't an option (I've hidden some details).

Is there a way to ignore a specific path entry?

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

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

发布评论

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

评论(2

無處可尋 2024-08-27 12:55:06

您使用FIGNORE,尽管它有一些奇怪的属性。

FIGNORE 需要正确的后缀。因此,要忽略 foo-bar,其中任何一个都可以:

FIGNORE=bar
FIGNORE=-bar
FIGNORE=r
FIGNORE=oo-bar

导入的东西不能尝试 FIGNORE=foo-bar 因为它不是一个正确的后缀。

You use FIGNORE, although it has some strange properties.

FIGNORE requires a proper suffix. So to ignore foo-bar, any of these will work:

FIGNORE=bar
FIGNORE=-bar
FIGNORE=r
FIGNORE=oo-bar

The import thing is not to try FIGNORE=foo-bar since it's not a proper suffix.

海夕 2024-08-27 12:55:06

尝试一下:

FIGNORE=foo-bar

Give this a try:

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