David
David

Reputation:

Vim cursor shape depending on current mode

I currently use MacVim for a lot of my editor needs but occasionally I need to edit files remotely over SSH. In MacVim the shape of the cursor varies depending on your current mode, i.e.
command mode -> block cursor and insert mode -> vertical bar cursor, which I find very helpful.

Is there a way to replicate this behavior in a .vimrc file, so that it can be used remotely?

Upvotes: 13

Views: 4292

Answers (1)

Vamshi Kadaru
Vamshi Kadaru

Reputation: 181

Try :help termcap-cursor-shape. There are two options there you can set:

  1. &t_SI - Shape when you enter insert mode.
  2. &t_EI - Shape when you exit insert mode.

In order for this to work, the Vim you are using must have been compiled with +cursorshape feature.

I personally always use gvim, so this was never a problem :). Hope this helps.

Upvotes: 9

Related Questions