Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 04:54:56 -1000
From:      Parv <parv@pair.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        Johannes-Maria Kaltenbach <johannes-maria@t-online.de>, freebsd-questions@freebsd.org
Subject:   Re: vim and cursor-over-"chars" question
Message-ID:  <20140910145456.GA4616@holstein.holy.cow>
In-Reply-To: <20140910152834.3aa4f6f6.freebsd@edvax.de>
References:  <mailman.77.1410350402.62559.freebsd-questions@freebsd.org> <20140910132008.GA1958@localhost> <20140910131448.GA1574@holstein.holy.cow> <20140910152834.3aa4f6f6.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <20140910152834.3aa4f6f6.freebsd@edvax.de>,
wrote Polytropon thusly...
>
> On Wed, 10 Sep 2014 03:14:48 -1000, Parv wrote:
> > in message <20140910132008.GA1958@localhost>,
> > wrote Johannes-Maria Kaltenbach thusly...
> > >
> > ...
> > > or you can set this xterm configuration in your .vimrc:
> > >
> > > for cursor in command mode:
> > >
> > > let &t_EI = "\<Esc>]12;orange\x7"
> > >
> > > and in insert mode:
> > >
> > > let &t_SI = "\<Esc>]12;orange\x7"
> > >
> > > where you can choose a different colour.
> >
> > Thanks much, Johannes-Maria.
> >
> > Only thing is that cursor color (with which xterm was started) is
> > not restored after editing or opening a file in vim. I can live with
> > that.
>
> This is correct, and the setting does not apply to gvim.
> Otherwise it works nicely in xterm.

Well there is a workaround, sort of, of setting the cursor
same/similar (to xterm cursor color) before leaving vim ...

  "  Cursor color (original xterm cursor color is not restored; see
  "  'termcap-cursor-shape' help topic for reference):
  if &term =~ "xterm"

    "  insert mode;
    let &t_SI = "\<Esc>]12;green\x7"

    "  command mode
    let &t_EI = "\<Esc>]12;orange\x7"
    "  color changes in command mode only after being in insert mode
    "  first; so try once more;
    silent !echo -ne "\033]12;orange\x7"

    "  Restore old xterm color; need to physically change here to
    "  match the one set at xterm launch.
    autocmd VimLeave    * silent !echo -ne "\033]12;grey\x7"
  endif

-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140910145456.GA4616>