glob expanding in readline / Bash like Vim's c_CTRL-A

preview_player
Показать описание
Recently, I learned about using [C-A] to expand objects with pattern in Vim, which can be used of expanding different object types, such as paths or function names.

Then, I looked into Bash, more precisely, the readline. It has also the similar functionality:

* glob-complete-word [M-g]
* glob-expand-word [C-x *]
* glob-list-expansions [C-x g]

The commands doesn't exist in readline(3), that means you probably don't have these in other programs which uses readline, but you may still be using the completion to have similar effect [M-*] and [M-?] (not with globbing)

When you press those keys, readline looks the text before the cursor as the pattern and will try to do the according action, either give you a list or expand for you.

At first glance, it seems to be redundant when you can already using something like `foobar*` literally without expanding in the prompt. But sometimes, you may want to take one or some of the files off the list, or for whatever needs that you need to have a list right in the prompt.
Рекомендации по теме
visit shbcf.ru