Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.