Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I set bash to show autocomplete options on a single tab press?

Tags:

bash

If bash autocomplete finds multiple files, it only autocompletes the common part and I have to press TAB again to have it show me a list of them.

I know there's a way to make this happen on the first TAB press, but how?

In other words, current behaviour:

$ cd fTAB

turns into:

$ cd foo

another TAB gets me a list "foobar foobiz".

What I want it to get that list on the first TAB.

like image 949
joachim Avatar asked Dec 23 '22 01:12

joachim


1 Answers

try adding

set show-all-if-ambiguous on

to your ~/.inputrc, like so:

echo "set show-all-if-ambiguous on" >> ~/.inputrc

btw: man bash is your friend - searching it for completion yields above answer.

like image 144
ax. Avatar answered Jan 13 '23 13:01

ax.