zsh-vi-mode
zsh-vi-mode copied to clipboard
Color retention of character block when deleting characters in visual mode
General information
Please report the following information as possible as you can:
- Terminal program: kitty
- Operating system: macOS
- ZSH framework: -
- ZSH version: 5.8
- ZVM version: HEAD
Basic examination
- [x] I have read through the README page
- [x] I have the latest version of zsh-vi-mode
- [x] I have tested with another terminal program
Problem description
Single visual selection character block retains visual selection colour. After the issue appears, the coloured block stays in the line regardless of any further movements / edits
Reproduction steps
- write a string: "string string string"
- esc - switch to normal mode
- v - visual mode
- b - move one word back
- x - delete selection
- i - switch to insert mode
Expected behavior
Visual mode selection colour should disappear.
Please see the image attached.

Putting the following in my .zshrc solved the above problem and similar problems I had when pressing āxā to delete in visual mode.
function zvm_after_lazy_keybindings() {
bindkey -M visual 'x' zvm_vi_delete
}
Being not very experienced with ZSH or this plugin, I do not know if this is a proper solution, but before I made the above change I noticed that ādā and āxā had different key bindings in visual mode:
% bindkey -M visual d
"d" zvm_vi_delete
% bindkey -M visual x
"x" vi-delete
I do not know whether this was due to a mistake in my configuration or whether this should be considered a bug in zsh-vi-mode.
Hi @sasha-glv
Thanks for your issue, and sorry for the late reply. Could you try again with the HEAD version, and let's see if this issue has been fixed or not?
Thanks & Regards