by wolfhumble · 7y ago · 0 comments
Using bash/zsh extensively, and Vim a few times a day, I have been wondering if people treat bash/zsh and Vim as two different worlds when it comes to keybindings, or is it common to use Vi/m keybindings in bash/zsh/other shells? Would love to hear some input on this! :-)
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-...
[1] https://wiki.archlinux.org/index.php/Readline#Editing_mode
https://www.gnu.org/software/bash/manual/html_node/Readline-...
I've toyed with taking what suckless have done with their libs and implement some alternatives (people still gripe about missing CP/M (DOS) shortcuts)
*I have never used them on osx and use a 50% keyboard.