From 1db9ea30ee6944d15134d74129f52cb495a856bc Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 1 Dec 2017 11:17:03 +0000 Subject: [PATCH] Enable cursor shape changes by default --- autoload/do.vim | 20 -------------------- plugin/settings.vim | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/autoload/do.vim b/autoload/do.vim index a2d1802..ce55419 100644 --- a/autoload/do.vim +++ b/autoload/do.vim @@ -1,23 +1,3 @@ -" Setup changing cursor dependant on mode -function! do#cursor_escape_sequences() - if has('unix') - if $ITERM_SESSION_ID !=# '' - let &t_SI = "\]50;CursorShape=1\x7" - let &t_SR = "\]50;CursorShape=2\x7" - let &t_EI = "\]50;CursorShape=0\x7" - else - let &t_SI = "\[6 q" - let &t_SR = "\[4 q" - let &t_EI = "\[2 q" - endif - if $TMUX !=# '' - let &t_SI = "\Ptmux;\".&t_SI."\\\" - let &t_SR = "\Ptmux;\".&t_SR."\\\" - let &t_EI = "\Ptmux;\".&t_EI."\\\" - endif - endif -endfunction - " Save, call isort on, then reload a python file. function! do#isort() if &filetype !=# 'python' diff --git a/plugin/settings.vim b/plugin/settings.vim index 4bb9144..b1307ba 100644 --- a/plugin/settings.vim +++ b/plugin/settings.vim @@ -115,3 +115,21 @@ set modeline " Don't redraw during execution macros, registers, commands, etc. set lazyredraw + +" Change cursor dependant on current mode +if has('cursorshape') && has('unix') && !has('gui_running') + if $ITERM_SESSION_ID !=# '' + let &t_SI = "\]50;CursorShape=1\x7" + let &t_SR = "\]50;CursorShape=2\x7" + let &t_EI = "\]50;CursorShape=0\x7" + else + let &t_SI = "\[6 q" + let &t_SR = "\[4 q" + let &t_EI = "\[2 q" + endif + if $TMUX !=# '' + let &t_SI = "\Ptmux;\".&t_SI."\\\" + let &t_SR = "\Ptmux;\".&t_SR."\\\" + let &t_EI = "\Ptmux;\".&t_EI."\\\" + endif +endif