Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to customize the vim cursor to be a blinking rectangle block. I tried this and this and many other similar stuffs after some searches, but none of them works as expected.

Currently my cursor is an non-blinking underline in grey (i.e. the underline below character "e" in the last line below), which is pretty hard to recognize.

underline cursor

When the cursor is over a parenthesis character, it becomes a block. (Actually I believe this is a change in background color) What I want is to have this block all the time, and blinking.

block cursor

I have nothing related to cursor style in my .vimrc file. I am using Mac OS X 10.9, Terminal Version 2.4 (326), and oh-my-zsh. In Terminal settings, I use Pro theme and set cursor to underline. I can change this to block so the cursor in vim changes as well, but I need the underline cursor in a normal Terminal.

terminal settings

share|improve this question

You may want to try adding this to your vimrc:

if exists('$TMUX')
    let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
    let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
    let &t_SI = "\<Esc>]50;CursorShape=0\x7"
    let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif

That should provide the correct escape sequences for tmux or iTerm.

I also found this plugin that auto changes the cursor based on the current mode.

share|improve this answer
    
It doesn't work. I use neither tmux nor iTerm. I am using the Terminal.app provided by Mac OS X and zsh. – Xiao Jia Feb 7 '14 at 0:36
    
Found this post and am using tmux - works great thanks! – ostler.c Jun 9 '14 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .