I want to be able to change vim's cursor color (as I did in macvim), but I am utterly failing to achieve this. I set my 'report termianl type' to xterm-256color.
This is my bashrc:
export TERM=xterm-256color
# If running interactively, then:
if [ "$PS1" ]; then
# enable color support of ls and also add handy aliases
# if [ "$TERM" != "dumb" ]; then
alias ls='ls -FG'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias sudo='sudo '
fi
and I added this to .vimrc (though it does not work):
if &term =~ "xterm*\\|rxvt*"
let &t_SI = "\<Esc>]12;sienna\x7"
let &t_EI = "\<Esc>]12;steelblue\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
Any suggestions?
BW
F
--
Federico Calboli
f.ca...@gmail.com
On 14 Apr 2012, at 04:55, iterm2-...@googlegroups.com wrote:
> changing vim cursor color
>
> George Nachman <gnac...@llamas.org> Apr 13 10:33AM -0700
>
> We don't support that escape code, unfortunately. There is another way to
> do it, though.
>
> Here's the bash command to make the cursor light blue (rgb 4040ff):
> echo -e "\033]Pl4040ff\033\\"
>
> Note that this doesn't do anything if you have smart cursor color turned on
> in prefs->profile->colors.
>
> It is described at the very end of this page:
> http://www.iterm2.com/#/section/documentation/escape_codes
This seems to work is somewhat decent way:
if &term =~ "xterm-256color\\|rxvt"
let &t_SI = "\033]Pl4682b4\033\\"
let &t_EI = "\033]Pla0522d\033\\"
silent !echo -ne "\033]Pla0522d\033\\"
autocmd VimLeave * silent !echo -ne "\033]Plc1ffc1\033\\"
endif
the only weird result is that when I close the first instance of vim I get many empty lines.
First off apologies for replying to a digest, but the damn google page does not let me post my reply online.
This seems to work is somewhat decent way:
if &term =~ "xterm-256color\\|rxvt"
let &t_SI = "\033]Pl4682b4\033\\"
let &t_EI = "\033]Pla0522d\033\\"
silent !echo -ne "\033]Pla0522d\033\\"
autocmd VimLeave * silent !echo -ne "\033]Plc1ffc1\033\\"
endif
the only weird result is that when I close the first instance of vim I get many empty lines.
>
> George Nachman <gnac...@llamas.org> Apr 14 01:24PM -0700
>
>
> > First off apologies for replying to a digest, but the damn google page
> > does not let me post my reply online.
>
> Sorry, I had to turn off web posting to reduce spam.
>
>
> > endif
>
> > the only weird result is that when I close the first instance of vim I get
> > many empty lines.
>
> Try this:
> let &t_ti="\e]Pl4682b4\e\\"
> let &t_te="\e]Pla0522d\e\\"
The above does NOT work, but the solution seems to be to comment out the line
silent !echo -e "\033]Pla0522d\033\\"
--
Federico Calboli
f.ca...@gmail.com