Move cursor change to vimrc

Sun, 18 Dec 2016 17:22:22 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 18 Dec 2016 17:22:22 -0500
changeset 453
e7b6a870f35d
parent 452
0fed20b49b89
child 454
e501f44a5885

Move cursor change to vimrc

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -571,15 +571,24 @@ if has('gui_running')
 
   colorscheme jellybeans
 else
-  if $TERM =~ 'screen'
+  if $TERM =~ '^screen'
     if $TERM == 'screen-bce'
-      " if i'm not screen-bce, i'm not sure i have a good .screenrc in place
       set t_Co=256
     endif
 
     set mouse=a
   endif
 
+  " vertical bar in insert mode.
+  if &term =~ '^\(xterm\|screen\|rxvt\)'
+    let &t_SI = "\e[5 q"
+    let &t_EI = "\e[0 q"
+    if exists("$TMUX")
+      let &t_SI = "\ePtmux;" . substitute(&t_SI, "\e", "\e\e", 'g') . "\e\\"
+      let &t_EI = "\ePtmux;" . substitute(&t_EI, "\e", "\e\e", 'g') . "\e\\"
+    endif
+  endif
+
   if $TERM =~ 'rxvt-unicode'
     set ttymouse=urxvt
     set mouse=a

mercurial