Command line tab and history completion

I find the default settings for tab completion on the bash command line slow. You have to press tab twice to get a result. To speed things up you can create a file in home called .inputrc to configure this.

nano ~/.inputrc

First start with
$include /etc/inputrc
to source the system configuration.

Then to reduces TAB pressings to only one:
set show-all-if-ambiguous on
set show-all-if-unmodified on

If you want to search your history halfway a command by pressing the up and down arrow key:
"\e[A": history-search-backward
"\e[B": history-search-forward

Now you can type cd and then press the up-key to get your last command that started with cd.

After saving .inpurc press C-x C-r to re-read-init-file

For more info on all the options see man bash

4 Likes

This I like. Thanks for sharing. :slight_smile:

Reminds me of fzf which I just love!