VIM - Vi IMproved  -  Unix and Color Highlighting

[ Home - Syntax Files - Rxvt - Dead Keys - Compiling - Ispell - Download ]

If you've never seen some highlighting examples check out a java source file, a Makefile or an html file with embedded javascript.

To be able to use syntax highlighting on a Unix/Linux box you need either a terminal that supports color or you have to use the X version of vim (called gvim). Me, I'm using the X-terminal emulation rxvt, but other terminal emulation like color-xterm are also possible. You also need to have a correct terminfo or termcap entry and to make use of all those colors you need to create your own syntax color definition file.

Configuring rxvt and terminfo

rxvt allows 18 different colors and those can usually be defined in your .Xdefaults file in your home directory. I'm using vim on a Laptop under Linux and on AIX with a normal XTerminal. Due to the different display technology I need two very different color definition files:

Linux / Laptop
AIX / XTerminal

Note that depending on your configuration you may have to execute xrdb each time you changed the .Xdefaults file. Note also that terminals that are already open will not use the new values, so you have to reopen a new terminal to check how your color choice looks like.

If your terminfo / termcap library does not include an entry for xterm-color (which is used for rxvt, while color-xterm is used for the color xterm program), you need to create your own. I'm using terminfo, and there you can create this entry (you have to be root to do this, if you do not have root permissions see below) by executing

     tic xterm-color.tic
Use my xterm-color.tic file if you don't have one. Also, the rxvt distribution includes a handy file that displays all the possible color combinations. I changed it a little bit to also show the default colors (

If you do not have root privileges you can create your own terminfo database by creating a directory and pointing the TERMINFO environment variable there. Me, I'm using

     setenv TERMINFO /home/cfl/lib/terminfo
     tic xterm-color
     setenv TERM xterm-color

(C) 1997-2001 Claudio Fleiner