Tuesday, May 28, 2019

Re: Cursor shape in the console

The following works in xterm. I'm investigating further for konsole:

" try to change cursor shape in Console mode in xterm-like terminals
" ESC [2 q = █ (Normal)
" ESC [4 q = _ (Replace)
" ESC [6 q = | (Insert)
" ESC [5m = blink (all modes)
if !has('gui_running') && has('termresponse') && has('cursorshape') &&
has('autocmd')
func CursorU(mode)
if a:mode == 'r' || a:mode == 'v'
let &t_SI = "\<ESC>[4 q"
else
let &t_SI = "\<Esc>[6 q"
endif
endfunc
augroup consCursor
au TermResponse *
\ if &t_EI == '' | let &t_EI = "\<Esc>[2 q" | endif
\| if &t_SI == '' | let &t_SI = "\<Esc>[6 q" | endif
\| if exists('&t_SR')
\| if &t_SR == '' | let &t_SR = "\<Esc>[4 q" | endif
\| else
\| au InsertChange,InsertEnter * call CursorU(v:insertmode)
\| endif
au VimLeave exe "normal \<C-\\>\<C-N>"
augroup END
endif


Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXu9Ugjs44MCRu1c_7PSo5%3Dyg%3DJn7AX3y0Ezp1HzFe6w_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment