zsh-vi-mode
zsh-vi-mode copied to clipboard
Cursor is initially block shaped and switches to block shape after time
When opening a new terminal, the cursor is initially block shaped
when it should be in bar/beam shaped
To switch to beam shape, I have to type a full normal mode command (e.g. dd) or press i/a/I/A, but then it switches back to block after a short time.
I tried this other plugin and don't have this same problem: https://github.com/softmoth/zsh-vim-mode Is there a way to disable the cursor functionality of zsh-vi-mode?
Hi @mskar
You can custom your cursor style (See here). I will add an option to support disabling the custom cursor style in the future.
Thanks and regards
Hi @mskar
About the issue that it switches back to block after a short time, are you using the Tmux?
Thanks and regards
Hi @jeffreytse, yes, I am using tmux.
Hi @mskar
It's reasonable for the cursor switching back to block. Because the tmux is a terminal multiplexer, there are multiple terminal in the same session, so any one program of this session could change the cursor. So I think you have a vim program in the session and the (n)vim will set the cursor style by timer automatically.
Thanks and regards
Hi @mskar
Now the commit (48c7d66) has provided the ZVM_CURSOR_STYLE_ENABLED
option to disable the cursor style feature, if you don't want the cursor style, you can set it to false
.
Thanks and regards
Hello @jeffreytse and @mskar, I wanted to confirm that I also experienced this behavior when I was used nvim
and this plugin in a tmux session. I have used the ZVM_CURSOR_STYLE_ENABLED
variable as @jeffreytse suggested so that now I always have a consistent style for the cursor. While it would be nice to have different styles for the cursor, I think that it is better if the cursor always signifies the correct state. Thanks for clarifying this issue @jeffreytse!
Hi @gkapfham , this issue is the same as another one #11, and currently the cursor will be auto updated when typing, so you can still enable this cursor style feature.
Same as #11
Hi @jeffreytse, I tried setting ZVM_CURSOR_STYLE_ENABLED
to false
, as described in the README but the cursor always remains block shaped.
I tried it both inside and outside the configuration function.
It seems like zsh-vi-mode is still overriding the cursor style settings in my .zshrc.
Is there a way to tell the plugin to not do anything related to the cursor at all and just let my .zshrc handle cursor style?
I also tried setting set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
in my tmux config, as described here.
Adding ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
instead of ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
seems to prevent the cursor starting out block shaped, but the cursor still reverts to being block shaped.
Hi @mskar
Once you disable the cursor style feature, the cursor style will follow your default settings of your terminal emulator, and this plugin will not apply any styles to the terminal emulator, for most of terminal emulators, block shape is default.
Thanks and Regards
Hi @jeffreytse, I took a look at this again and I noticed that the cursor shape is fine outside of tmux. This has to be related to something in my tmux config.