In comp.editors, Jeremy Brubaker <jbruba...@orionarts.invalid> wrote:
> I am trying to get the fore- and background colors of my terminal in my
> .vimrc. I found the /t_RB/ and /t_RF/ options in the manual, but either
> they don't work or I'm not using them properly (likely the latter).
>
> I tried `set t_RB` and then `echomsg v:termrbgresp` and just got an
> empty string. Do I need to set /t_RB/ to something specific for this to
> work?
The only reason to assign values to the t_?? settings is to "correct"
(often correct is more opinion than fact) the terminal settings. I have
in my .vimrc:
" t_Co number of colors supported by the terminal
set t_Co=0
and if I try ":set t_RB?" I get back an empty string. Testing by
commenting that setting out, I get color in vim, but still see t_RB as
empty here (version 8.2.3615 on NetBSD in an xterm, but TERM set to
"screen"). Trying on Linux, version 8.1.2269, same version xterm, but
TERM set to xterm, I do get a value for RB:
:set t_RB?
t_RB=^[]11;?^G
> For context, I'm trying to create some functions that will set some UI
> colors based on my terminal background color. Specifically /CursorLine/
> right now.
I find white on black is best, so I don't really have experience to help
debug colors in vim. Have you tried the vim mailling list? ":help vim-use"
Joining the list and using the subscriber posting address is faster, but
the address in the help works.
I also set t_TI and t_TE to empty strings (start and stop of raw mode)
and used to use a t_ setting for mouse, but I've found "set ttym=" to
be more what I want.
Back when I was using actual terminals, instead of xterms always, I had
more opinions about termcap/terminfo settings. I've forgotten many of the
details.
vi is one of the oldest terminal oriented programs, and these t_??
options date back to the late 1970s, early 1980s. Early vi used very few
of them. ex-1.1, first to include a "visual" mode about a donzel calls
to a tget(num|flag|str) family function in the source.
Elijah
------
has a compiled version of ex-1.1 and has used it briefly