search

Home  >  Q&A  >  body text

How to make the vim cursor in the shell have different shapes in different states

For example, when inserting, "|" is displayed, and when in command mode, a square is displayed?
In macvim, the shape will be changed by default, but not in the shell. How to configure it?

曾经蜡笔没有小新曾经蜡笔没有小新2742 days ago850

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-16 16:44:34

    You can use guicursor to set the cursor of Gvim. For example, if you only set the cursor to '|' in insert mode, you can use the following configuration:

    set guicursor=i:ver1
    

    The reason why the cursor shape will definitely not change in the shell is because the cursor in the shell is the setting of the shell (gnome-terminal). The reason why cursor is set to guicursor means that this setting is only for gvim (g in gvim means gui)

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 16:44:34

    if $TERM_PROGRAM =~ "iTerm"
    let &t_SI = "\]50;CursorShape=1\x7"
    let &t_EI = "\]50;CursorShape=0\x7"
    endif

    reply
    0
  • Cancelreply