On 12/28/08, Dave Wood wrote:
>
> On (16:03 28/12/08), Tony Mechelynck wrote:
>> If you make sure these codes are undefined, Console Vim will never
>> change the cursor shape. This is the default and that's why I mentioned
>> a possible system vimrc in my reply of a few minutes ago.

Unless, of course, some *other* code that vim sends changes the cursor shape...

> Might just as well set then undefined then. There is one thing I noticed -
> if my TERM is set to 'linux' it changes cursor, but if I use xterm-xf86-v40
> it doesn't change the cursor.

So, based upon this, the answer was easy enough to find.  Just
looking at the output of 'infocmp -d linux xterm-xf86-v40'
I noticed:

cnorm: '\E[?25h\E[?0c', '\E[?25h'

Which, thanks to 'man 5 terminfo', you can explain as "To reset
the cursor to normal visibility, rather than invisible or very
visible, in a linux terminal, send the code '<Esc>[?25h<Esc>[?0c'.
To do the same for an xterm-xf86-v40 terminal, send the code
'<Esc>?25h'."  This means that on a "linux" terminal, the cursor
shape will be reset to the default.

To change that, you could throw this into your ~/.vimrc:

if 1
  let &t_ve = substitute(&t_ve, '\e[?\zs0c', '6;14;224c', 'g')
endif

That says "If the terminal's 've' attribute (which is the termcap
name for what terminfo calls 'cnorm') matches /\e[?0c/, replace
the 0c with 6;14;224c" - ie, use *your* prefered cursor type,
instead of the default cursor type.  It's pretty likely that other
applications will also use cnorm, though, so you might want to
just change your 'cnorm' sequence in your terminfo database,
instead...

~Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to