Permalink
Browse files

Lagless vim cursor shape changing under tmux.

  • Loading branch information...
1 parent e69179d commit 86591163c648809a6f1d9afd93b2e8d997cf3508 @thegreatape committed Oct 31, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −0 tmux.conf
  2. +8 −3 vimrc
View
@@ -0,0 +1 @@
+set -sg escape-time 0
View
11 vimrc
@@ -126,12 +126,17 @@ autocmd BufWinLeave * call clearmatches()
" change cursor shape in insert mode. requires building master of
" iTerm2, at least as of 11-22-12
-let &t_SI .= "\e[6 q"
-let &t_EI .= "\e[2 q"
+if exists('$TMUX')
+ let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
+ let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
+else
+ let &t_SI = "\<Esc>]50;CursorShape=1\x7"
+ let &t_EI = "\<Esc>]50;CursorShape=0\x7"
+endif
inoremap <special> <Esc> <Esc>hl
set guicursor+=i:blinkwait0
-" Enable 256 colors to stop the CSApprox warning and make xterm vim shine
+" Enable 256 colors to stop the CSApprox warning
if &term == 'xterm' || &term == 'screen'
set t_Co=256
endif

0 comments on commit 8659116

Please sign in to comment.