All the cool kids are setting their shells to vi mode by adding
to their .bashrc. I’ve been going back and forth myself, as I like the improved editing of vi mode on the command line but don’t enjoy the hassle of having to reenter insert mode after inadvertently entering normal mode.
vi mode does have the drawback that it disables a terminal emulator’s CTRL+L shortcut for clearing the screen in insert mode. If I have to leave insert mode, press CTRL+L, and reenter insert mode, I might as well type clear. A faster solution is needed.
Enter .inputrc: this file allows the formulation of aliases or macros bound to key combinations. To emulate normal CTRL+L behaviour in vi insert mode, I’ve added the following lines to ~/.inputrc: