zsh-vim-mode
zsh-vim-mode copied to clipboard
[feature] Add support for viopp's cursor
case $keymap in
DEFAULT) set-terminal-cursor-style ;;
replace) set-terminal-cursor-style ${=MODE_CURSOR_REPLACE-$=MODE_CURSOR_VIINS} ;;
vicmd) set-terminal-cursor-style ${=MODE_CURSOR_VICMD} ;;
isearch) set-terminal-cursor-style ${=MODE_CURSOR_SEARCH-$=MODE_CURSOR_VIINS} ;;
visual) set-terminal-cursor-style ${=MODE_CURSOR_VISUAL-$=MODE_CURSOR_VIINS} ;;
vline) set-terminal-cursor-style ${=MODE_CURSOR_VLINE-${=MODE_CURSOR_VISUAL-$=MODE_CURSOR_VIINS}} ;;
main|viins|*)
set-terminal-cursor-style ${=MODE_CURSOR_VIINS} ;;
esac
there doesn't exist viopp. when user press 'd', 'c', 'y' in vicmd keymap, the cursor shape can not change. why don't add it?
Application
when i press 'S', 'ysiw', etc in visual, vicmd keymap, the selected region will disapper:
in visual keymap
after press 'S'
after press "("
the selected region disappear make me confused ( i am afraid i press 'd' to delete the word not 'S' ), so if i can change the sursor shape to '_' to indicate me i have pressed 'S' will be better. that is why i open this issue.
thanks!
Hi, thank you for this bug report. I have two separate comments on it.
First, I don't get the behavior that the selected region disappears. For example,
- type in the text
abcd
- press
<Esc>
thenhvh
: visual mode withbc
selected - press
S
: line does not appear to change at all - press
"
: text isa"bc"d
Maybe it's because of Zsh version? Or some other plugin?
Second, I don't know of a way to get an event triggered in this instance. Zsh ZLE does not call the line-pre-redraw
hook at this time (when you press S
), so I don't have a way track it. I believe some other Vim-mode plugins avoid the ZLE hook mechanism and redefine key presses instead, and that approach might allow for more fine-grained control here.
I could be mistaken here, it seems odd to me that you're seeing a very different behavior. I have:
% zsh --version
zsh 5.8 (x86_64-pc-linux-gnu)
Kind regards,
Tim