Make BASH's Tab Completion Fill In First Match?
Add the following to your .inputrc
file, (exact location varies between systems):
"\C-i": menu-complete
This maps TAB to menu-complete, which auto-completes the first match.
Then add (or uncomment) show-all-if-ambiguous
, this shows the list of possible completions on the first TAB press.
Alternatively, you can set menu-complete per session (without editing .inputrc
) by doing
bind '"\C-i" menu-complete'
Though I don't know about getting this functionality to work with bash, zsh comes with set up with exactly what you want by default. Check out oh-my-zsh and zsh.
zsh has most of the features of bash with some added functionality out of the box, like the ability to navigate with only tab and enter!
Most linux distributions come with a package for installing zsh.