Readline visual cues
Published 2026-07-28I've written about configuring readline to automagically enable vi mode. After seeing a coworker's bash prompt, I've added a couple more lines to my bashrc.
set editing-mode vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[1;34m\2 [INS] \1\e[0m\2
set vi-cmd-mode-string \1\e[1;34m\2 [CMD] \1\e[0m\2
show-mode-in-prompt prepends a visual indicator of the current mode. In our case, [INS] and [CMD] for insert and command mode, respectively. What's even better is that it gets picked up for free wherever readline is available.