You are not logged in.

#1 2017-08-08 19:44:12

Registered: 2015-08-10
Posts: 2,482

bash: inputrc: Tune Bash tab completion.


# Colour in <Tab> completions
set colored-stats on

# Case-insensitive matching when completing. Increases comfort a lot.
set completion-ignore-case on

# Don't double-tab for completion suggestions when the pattern is ambigious.
set show-all-if-ambiguous on

# The common prefix of all completion suggestions is shown in a different color.
set colored-completion-prefix on

More interesting settings may be available: … rltop.html.

A silent kite against the blue, blue sky


#2 2017-08-09 02:01:46

From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,713

Re: bash: inputrc: Tune Bash tab completion.

My favourite, up-arrow for history completions. Type the start, then ↑ to get the recent commands beginning thus (I use this every day):

# some defaults / modifications for the emacs mode
$if mode=emacs

## --other stuff--

# use up & down arrows to search history
"\e[C": forward-char
"\e[D": backward-char


More: … -Init-File

( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.


#3 2019-02-17 08:16:01

Registered: 2015-09-29
Posts: 3,895

Re: bash: inputrc: Tune Bash tab completion.

I came back to this whilst looking for a way to solve a different problem:
I was trying to find a way to make aliases reveal themselves when executed (so that I don't forget the original commands).
I tried by prepending each alias with a call to alias, e.g.:

alias grep='alias grep; grep --color=auto'

but it interferes with piping.

I tried to write a custom function that outputs the alias to stderr:

alias grep='alias_func grep; grep --color=auto'

but it still interferes with piping.

So I remembered that inputrc offered something pertaining to aliases.
The closest I got was by adding this to /etc/inputrc:

"\C-a": alias-expand-line

but it requires me to type Ctrl-a to execute it.

Any way to make aliases reveal themselves without intefering with piping?

There's some really cool stuff here. Got lost reading 'man bash', readline section.
I wish I knew enough to not break it. Some things remain unclear even after reading the docs, e.g. the bash builtin 'complete'...

twoion, the link from your first post seems broken. Is that still available? If it's just a general introduction like johnraff posted, no need.


#4 2019-02-17 09:33:01

Registered: 2015-08-20
Posts: 5,057

Re: bash: inputrc: Tune Bash tab completion.

ohnonot wrote:


Any way to make aliases reveal themselves without intefering with piping?

Not sure if it fits your use-case, but I have a "keybinds-pipemenu" for displaying various application keybinds, including aliases. The relevant command to show all aliases is

awk '$1 ~ /^alias/{$1 = "";print}' $HOME/.bash_aliases

Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt


Board footer

Powered by FluxBB