zsh-vim-mode icon indicating copy to clipboard operation
zsh-vim-mode copied to clipboard

[feature] Add support for viopp's cursor

Open Freed-Wu opened this issue 2 years ago • 1 comments

            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 image after press 'S' image after press "(" image 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!

Freed-Wu avatar Aug 02 '21 08:08 Freed-Wu

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,

  1. type in the text abcd
  2. press <Esc> then hvh: visual mode with bc selected
  3. press S: line does not appear to change at all
  4. press ": text is a"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

softmoth avatar Dec 02 '21 22:12 softmoth