bash – How to Cycle Through Suggestions in Terminal Autocomplete

autocompletebash

I had this on my Ubuntu setup and since I switched to Fedora I want to set it and I forgot how… The idea is simple :

I don't want the terminal to show me suggestions when I double tab, instead I want it to cycle through every possible suggestion with each press on tab… this can be done in Vim also.

So when I type gedit a and press tab it will show me every file with a first letter a.

Best Answer

This is actually a readline feature called menu-complete . You can bind it to tab (replacing the default complete) by running:

bind TAB:menu-complete

You probably want to add that to your ~/.bashrc. Alternatively, you could configure it for all readline completions (not just bash) in ~/.inputrc.

You may also find bind -p (show current bindings, note that shows tab as "\C-i") and bind -l (list all functions that can be bound) useful, as well as the bash manual's line editing section and readline's documentation.

Related Question