4
1
I am using PuTTY to connect over SSH to an Ubuntu server from my Windows 7 workstation. Once connected I am using the Vim installation from the Ubuntu server to edit files. I want the cursor to change when I go into and out of insert mode. Part of my .vimrc file is like this but it is not changing the cursor:
if &term =~ "xterm"
echo "xTerm!!inate!"
let &t_SI = "\<Esc>]12;purple\x7"
let &t_EI = "\<Esc>]12;blue\x7"
endif
I know that the if statement is executing because of the echo.
EDIT: Actually I would prefer to change the cursor to be a vertical line like you can in the PuTTY settings rather than change the color, or maybe even do both. But just changing the color would be a lot better than nothing. Also I am willing to change terminals if there is another Windows 7 Professionsal 64 bit compatible terminal that can do this (preferably something free). Maybe Poderosa can do this?
Is there a different terminal that will let you change the cursor width or color? – still_dreaming_1 – 2011-06-30T16:16:55.673
1
@INTPnerd Mintty. It's derived from PuTTY, but it's generally more compatible with xterm and does support the xterm colour sequences (except that it only supports colour values, not names). It also implements a control sequence for changing cursor style. See this tip on how to put that to use in vim. Mintty requires Cygwin or MSYS though.
– ak2 – 2011-06-30T19:26:00.480@ak2 Thanks! Mintty works for this, but there is an annoying delay before the cursor changes when changing modes. IDK if that's Mintty's fault or not... – still_dreaming_1 – 2011-06-30T21:13:54.207
1
@INTPnerd That's vim's escape timeout. See the next tip on how to avoid it.
– ak2 – 2011-07-01T03:04:55.033I don't think that's it. I tried that tip and it did not help. The delay is not only when I press escape to leave insert mode but also when I enter insert mode. – still_dreaming_1 – 2011-07-01T16:17:38.583
1@INTPnerd Ah, that's a bug then, introduced in version 0.9. The cursor shape is only updated when the cursor blinks or moves, whereas of course it should be updated right away. – ak2 – 2011-07-02T11:00:05.673