Is there a way to make bash use visual selections for text replacement?
Standard text input conventions don't work:
- If you press Shift+Left Arrow, the character to the left should be visually selected
- If you press Ctrl+Left Arrow, the cursor should move to the beginning of the previous word
- If you press Shift+Ctrl+Left Arrow, the word to the left should be visually selected
- If you visually select some text then press any key, the text should be replaced with the text of the key you press
Vi mode (set -o vi) visual selection conventions don't work:
- If you enter normal mode, press 'v' to enter visual selection, then press 'h', it should visually select the character to the left
- If you enter normal mode, press 'v' to enter visual selection, then press 'B', it should visually select the word to the left
- If you visually select some text and then press 'R', it should erase the text and leave you typing the replacement
this guy did it for zsh:
it's awesome!
When I want to do this in ZSH I use
edit-command-line
. You can add the following into your.zshrc
:Then I can just type
v
in command mode and it will open up my$EDITOR
. You can do the same thing in Bash by just typingv
in command mode without any customization.