简体   繁体   English

Bash-自动完成 <TAB> -查找所有事件并自动选择一个

[英]Bash - autocomplete <TAB> - find all occurence and auto select one

I have checked a lot of other answers but did not really find what I am looking for. 我检查了许多其他答案,但没有真正找到我想要的东西。 Problem is I need to reproduce this with a bash auto-completion a zsh function: 问题是我需要使用bash自动补全zsh函数来重现此内容:

If I got this: 如果我明白了:

: ls -l
drwxr-xr-x 2 user user 4096 Feb 12 21:17 Desktop
drwxr-xr-x 3 user user 4096 Feb 13 14:11 Documents
drwxr-xr-x 2 user user 4096 Feb 13 14:18 dotfiles
drwxr-xr-x 4 user user 4096 Feb 15 09:03 Downloads

In zsh I can type: 在zsh中,我可以输入:

: fil <hit tab>

Zsh will complete dotfiles folder name by itself. Zsh将自己完成dotfiles文件夹的名称。 or if I got more than one folder who contain the string, he will give me a selection choice with all the occurence. 或者,如果我有一个以上包含字符串的文件夹,他将为我提供所有出现的选择选项。

Any idea or script that do this ? 任何想法或脚本做到这一点?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM