You are not logged in.

#1 2008-12-05 11:38:41

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

gvim and vim cursor

When we press insert or i in gvim the cursor shape changes from a fat block to thin and back to fat state when esc  is pressed. But I also want this behavior in vim, is it possible to set that in vim. I am using sakura as terminal.

Offline

#2 2008-12-05 12:25:55

alexsuraci
Member
Registered: 2008-09-27
Posts: 15

Re: gvim and vim cursor

I don't think so. gVim can do that because it's applying a UI to vim, but since regular vim is a CLI app it's limited to what terminals can display.

Offline

#3 2008-12-05 13:33:02

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: gvim and vim cursor

I think this has been discussed here before and I don't think anyone came up with a solution unfortunately.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#4 2008-12-05 17:05:07

davvil
Member
Registered: 2008-05-06
Posts: 165

Re: gvim and vim cursor

Have a look at the t_EI and t_SI options.

I have these lines in my .vimrc for changing the cursor color depending on the mode

    if &term =~ "rxvt-unicode"
        "Set the cursor white in cmd-mode and orange in insert mode
        let &t_EI = "\<Esc>]12;white\x9c"
        let &t_SI = "\<Esc>]12;orange\x9c"
        "We normally start in cmd-mode
        silent !echo -e "\e]12;white\x9c"
    endif

The escape codes are terminal dependent, I use urxvt. Have a look at the documentation of sakura if it allows to change the cursor shape.

Edit: Corrected the test from general rxvt to rxvt-unicode (also in my .vimrc! :-))

Last edited by davvil (2008-12-05 17:08:05)

Offline

#5 2008-12-05 23:31:24

elmer_42
Member
From: /na/usa/ca
Registered: 2008-10-11
Posts: 427

Re: gvim and vim cursor

I think most terminals set their cursor once at the beginning and don't ever re-check the configuration file. The only thing that comes to mind to solve this problem would be to rewrite the configuration file every time you hit i and then somehow force your terminal to re-load the configuration file.


[ lamy + pilot ] [ arch64 | wmii ] [ ati + amd ]

Offline

#6 2008-12-08 05:10:45

jaideep_jdof
Member
From: Delhi, India
Registered: 2006-06-05
Posts: 311

Re: gvim and vim cursor

Thanks for the help guys.

Offline

Board footer

Powered by FluxBB