On 2009-04-02, Taylor Venable wrote:
> I have an xterm compiled with 256 color support. In Vim 7.2.88 after
> it loads up I can do :set t_Co to find that 256 color support is being
> found correctly (TERM = xterm-color). However, I cannot figure out
> how to determine whether 256 colors are supported on startup, as the
> value of t_Co is 8 at the time my .vimrc is loaded.
>
> I've tried a few autocommands, such as VimEnter and TermChanged but
> the value of t_Co in both of them is still 8, rather than the 256 I
> expect. At what point does t_Co get set to reflect the capabilities
> of the terminal, and how can I detect it during startup?
Vim gets it from the terminfo database for your TERM by calling
tgetnum("Co") if it wasn't already defined by the termcap string.
It does this before ~/.vimrc is read. So if the terminfo database
for "xterm-color" says that terminal has 256 colors, Vim should set
t_Co to 256. On the Red Hat system I just tried in on, however,
"infocomp xterm-color" says "colors#8". If you want Vim to know
that your terminal supports 256 colors, perhaps you should set TERM
to "xterm-256color".
Or are you saying that t_Co gets set automatically somehow to 256
and you don't know where that is? If so, you can find out by
executing
:verbose set t_Co?
HTH,
Gary
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---