Skip to content

Instantly share code, notes, and snippets.

@nastysloper
Created March 17, 2015 13:55
Show Gist options
  • Save nastysloper/5c4156c5762cee3efd87 to your computer and use it in GitHub Desktop.
Save nastysloper/5c4156c5762cee3efd87 to your computer and use it in GitHub Desktop.
Change cursor shape in Vim depending on mode
This tip courtesy of Erlend Hamberg
http://hamberg.no/erlend/posts/2014-03-09-change-vim-cursor-in-iterm.html
" Change cursor shape between insert and normal mode in iTerm2.app
if $TERM_PROGRAM =~ "iTerm"
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment