Git Product home page Git Product logo

Comments (5)

jeffreytse avatar jeffreytse commented on May 11, 2024 3

Hi @ftpd

In fact, this plugin has provided an option for configurating the cursor style. And you can find out all the configuration details in the head of source code:

# ZVM_VI_NORMAL_MODE_CURSOR:
# the prompt cursor in vi normal mode
#
# ZVM_VI_INSERT_MODE_CURSOR:
# the prompt cursor in vi insert mode

and

zsh-vi-mode/zsh-vi-mode.zsh

Lines 119 to 125 in aad07d8

# Default cursor styles
ZVM_CURSOR_BLOCK='\e[2 q'
ZVM_CURSOR_BEAM='\e[6 q'
ZVM_CURSOR_BLINKING_BLOCK='\e[1 q'
ZVM_CURSOR_BLINKING_BEAM='\e[5 q'
ZVM_CURSOR_XTERM_BLOCK='\x1b[\x32 q'
ZVM_CURSOR_XTERM_BEAM='\x1b[\x36 q'

As mention above, you can set the cursor style in insert mode to a beam as below in your .zshrc file:

# Set the sursor stlye of defferent vi modes
if [[ ${TERM:0:5} == 'xterm' ]]; then
  ZVM_VI_INSERT_MODE_CURSOR=$ZVM_CURSOR_XTERM_BLOCK
else
  ZVM_VI_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK
fi

Thanks and regards

from zsh-vi-mode.

jeffreytse avatar jeffreytse commented on May 11, 2024 3

Hi @ftpd

The latest commit ( f9b508d ) has provided some options for users to custom the cursor style for better terminal compatibility.

  1. You can set your cursor style for different vi mode:
# ZVM_NORMAL_MODE_CURSOR:
# the prompt cursor in normal mode
#
# ZVM_INSERT_MODE_CURSOR:
# the prompt cursor in insert mode
#
# ZVM_VISUAL_MODE_CURSOR:
# the prompt cursor in visual mode
#
# ZVM_VISUAL_LINE_MODE_CURSOR:
# the prompt cursor in visual line mode
  1. And the below cursor styles are supported:
ZVM_CURSOR_BLOCK
ZVM_CURSOR_UNDERLINE
ZVM_CURSOR_BEAM
ZVM_CURSOR_BLINKING_BLOCK
ZVM_CURSOR_BLINKING_UNDERLINE
ZVM_CURSOR_BLINKING_BEAM
  1. Custom your cursor style is easy as below:
ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLOCK
ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLINKING_UNDERLINE

Thanks and regards

from zsh-vi-mode.

ftpd avatar ftpd commented on May 11, 2024 2

Thanks - I haven't seen it in Readme, so I somehow thought it's not supported. I should take a look into code ;-)

I'm closing this issue as fixed now.

from zsh-vi-mode.

jeffreytse avatar jeffreytse commented on May 11, 2024 2

Hi @ftpd

😄 You are welcome. And you can star this repository for the updates and features in the future. Currently I'm focusing on this plugin and making it better and better.

Thanks and regards.

from zsh-vi-mode.

ftpd avatar ftpd commented on May 11, 2024 1

Wow, neat! Thanks!

from zsh-vi-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.