Archive for December 29th, 2005

Easiest way to get Vim colors in AIX

December 29th, 2005 | Category: AIX, Opensource

Put this in your .vimrc:

:if has("terminfo")
: set t_Co=16
: set t_AB=Esc[%?%p1%{8}%< %t%p1%{40}%+%e%p1%{92}%+%;%dm
: set t_AF=Esc[%?%p1%{8}%< %t%p1%{30}%+%e%p1%{82}%+%;%dm
:else
: set t_Co=16
: set t_Sf=Esc[3%dm
: set t_Sb=Esc[4%dm
:endif

(Note: the Esc’s should be replaced with a real Esc (Ctrl-v Esc).)

This should give you sixteen-color support if you are using an xterm (or a derivative, like rxvt, konsole, etc.) that supports color (the standard xterm in AIX 5.3 does not appear to support color). At least it did for me in the 30 seconds I took to test it. You can also change TERM:

TERM=xterm-color (only supports eight colors)
or
TERM=xterm-16color

If you make these changes to TERM though, you will most likely run into problems with other tools (like man and telnet) that won’t know about this terminal type, unless you update the terminfo database. The .vimrc code is courtesy of the excellent help in vim.

No comments