#4892

I've been making changes to my .inputrc file to improve my command line experience in bash shell and other readline interfaces. I like enabling vi mode to use the key bindings of my preferred editor. I recently was made aware that the setting to do this unsets all previously set custom key bindings in the .inputrc, even for keys that aren't directly used by the mode. This led to some confusion for me when my custom keys weren't working.

I had my .inputrc sorted alphabetically by section, which put "vi" below other sections that had some custom keys set. In this example:

"\e[B": history-search-forward
"\e[A": history-search-backward
set editing-mode vi

the first two lines rebind up and down to take into account entered text in history navigation. However, the third line, which enables vi mode, undoes this change, making up and down revert to their normal text-unaware history navigation. The set line must be moved above the others (all bindings) to allow those bindings to work.

So now all my key bindings are below my set lines. A little misunderstanding that took some extra time for me working on my dotfiles.


</toby>