4

I was reading about key-bindings in Bash. They seem to be based on Emacs but offer the ability to switch to vi based ones.

You can do set -o vi in your .bashrc to effect Bash, but I saw there was also an option to edit a file called .inputrc by adding the following line:

set editing-mode vi

By editing .inputrc instead of .bashrc all programs which use the GNU Readline Library will switch to vi keybindings.

I probably won't switch the bindings as I'm use to the Emacs ones now and I like using defaults, but this fact has gotten me curious about GNU Readline and .inputrc. What popular utilities and programs make use of this library?

1 Answer 1

9

This isn’t an exhaustive list, and I haven’t tried to determine popularity: Abiword, Amanda, Atari800, Bacula, Bareos, GNU bc, BlueZ, Cdecl, ConnMan, Freeciv, FreeRADIUS, GNU ftp, NetKit ftp, FVWM, GDB, GPG, Guile, Hatari, Hunspell, Lftp, NetworkManager, nftables, Parted, the rc shell, Samba, SQLite, GNU Units, VICE, Wesnoth, WPA Supplicant...

A number of languages, including Lua, Python, and Ruby, also use Readline, whether for their REPLs or to provide Readline bindings for programs written in those languages.

The rlwrap utility can provide Readline's line editing, persistent history, and completion to interactive utilities that otherwise lack these functionalities.

You can check for support yourself by looking at the reverse dependencies on libreadline (or equivalent) in your favourite distribution. Bash of course uses Readline but builds its own version.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.