jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
3.13k stars 109 forks source link

CURSOR COLOR #116

Closed HsunGong closed 3 years ago

HsunGong commented 3 years ago

Basic examination

iterm

can we change the cursor color like

RED="\e[31m"
NOCOLOR="\e[0m"
ZVM_NORMAL_MODE_CURSOR=$RED$ZVM_CURSOR_BLOCK$NOCOLOR
jeffreytse commented 3 years ago

Hi @HsunGong

For the custom cursor color, currently, you can follow below snippet:

# This function will be automatically executed by the plugin
zvm_before_init() {
  local ncur=$(zvm_cursor_style $ZVM_NORMAL_MODE_CURSOR)
  local icur=$(zvm_cursor_style $ZVM_INSERT_MODE_CURSOR)

  ZVM_INSERT_MODE_CURSOR=$icur'\e\e]12;red\a'
  ZVM_NORMAL_MODE_CURSOR=$ncur'\e\e]12;#008800\a'
}

Hope the code snippet can help you and welcome to star this project for further updates in the future. : )

Thanks and regards