Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how i can change cursor color in color scheme " vim "

I use this color scheme: Cobalt Colour scheme.

I cannot see the cursor in insert mode.

How I can change the cursor's color?

I think this is the cursor part:

hi CursorLine     guifg=none              guibg=#002943
hi Cursor         guifg=#F8F8F8           guibg=#A7A7A7
hi CursorIM       guifg=#F8F8F8           guibg=#002947"#5F5A60
like image 951
Tarek Saied Avatar asked Jun 03 '11 17:06

Tarek Saied


1 Answers

@GWW is right. But the example above only works for gvim, not vim. You'd better configure in .vimrc as in the same documentation to make it work in xterm, for example:

if &term =~ "xterm\\|rxvt"
  " use an orange cursor in insert mode
  let &t_SI = "\<Esc>]12;orange\x7"
  " use a red cursor otherwise
  let &t_EI = "\<Esc>]12;red\x7"
  silent !echo -ne "\033]12;red\007"
  " reset cursor when vim exits
  autocmd VimLeave * silent !echo -ne "\033]112\007"
  " use \003]12;gray\007 for gnome-terminal
endif
like image 86
troore Avatar answered Sep 28 '22 05:09

troore