13

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?

Teun Zengerink
  • 4,277
  • 5
  • 30
  • 32

1 Answers1

9

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.

Teun Zengerink
  • 4,277
  • 5
  • 30
  • 32
Vamshi Kadaru
  • 161
  • 1
  • 2
  • Unfortunately gVim isn't installed on the server I'm accessing. I did a little searching and it looks like the cursor shape can't be changed in regular Vim. Oh well. –  Aug 04 '09 at 21:41
  • @David, as of Vim 7.3 you can change the cursor in regular vim too. See http://stackoverflow.com/questions/6488683/how-do-i-change-the-vim-cursor-in-insert-normal-mode/6488717#6488717 – Natan Yellin Aug 26 '11 at 15:24