4 ms·
Personally, I have vi mode enabled for anything that uses readline. Some of my friends, though, have been reluctant to use it since the prompt doesn't indicate
by zwolbers 7y ago
Personally, I have vi mode enabled for anything that uses readline. Some of my friends, though, have been reluctant to use it since the prompt doesn't indicate which mode it's currently in.
But... That changed with recent versions of readline, which introduced 'show-mode-in-prompt' [0]. It's somewhat limited - it only prints an indicator at the beginning of the last row of the prompt. You can, however, change what text is displayed. I use it to emit escape codes that change the shape of the cursor (similar to vim itself) [1].
[0] https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html#index-show_002dmode_002din_002dprompt https://www.gnu.org/software/bash/manual/html_node/Readline-...
[1] https://wiki.archlinux.org/index.php/Readline#Editing_mode https://wiki.archlinux.org/index.php/Readline#Editing_mode