From 4c2d9b80892be09576fc88c2a401a36d98aa1c88 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 1 Dec 2017 10:44:43 +0000 Subject: [PATCH] Add do#cursor_escape_sequences() Control the cursor shape based on the current mode. --- autoload/do.vim | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/autoload/do.vim b/autoload/do.vim index ce55419..a2d1802 100644 --- a/autoload/do.vim +++ b/autoload/do.vim @@ -1,3 +1,23 @@ +" 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'