Vim Tips Wiki
Register
(Add some generic xterm notes)
m (add xterm help link so it's more obvious)
Line 10: Line 10:
 
}}
 
}}
   
xterm and most other modern terminal emulaters support 256 colors, you can use a script to [http://www.frexx.de/xterm-256-notes/data/256colors2.pl check if your terminal supports 256 colors].
+
XTerm and most other modern terminal emulaters support 256 colors, you can use a script to [http://www.frexx.de/xterm-256-notes/data/256colors2.pl check if your terminal supports 256 colors].
   
 
To enable colors on XTerm you will need to run the <tt>configure</tt> scripts with the <tt>--enable-256-color</tt> switch, in addition you may also need to set your <tt>TERM</tt> environment variable to <tt>xterm-256color</tt>.
 
To enable colors on XTerm you will need to run the <tt>configure</tt> scripts with the <tt>--enable-256-color</tt> switch, in addition you may also need to set your <tt>TERM</tt> environment variable to <tt>xterm-256color</tt>.
Line 20: Line 20:
 
<pre>setenv TERM xterm-256color</pre>
 
<pre>setenv TERM xterm-256color</pre>
   
  +
See http://frexx.de/xterm-256-notes/ for more information about 256 colors on XTerm
 
----
 
----
   

Revision as of 06:49, 17 April 2008

Tip 1312 Printable Monobook Previous Next

created August 23, 2006 · complexity basic · author lpenz · version n/a


XTerm and most other modern terminal emulaters support 256 colors, you can use a script to check if your terminal supports 256 colors.

To enable colors on XTerm you will need to run the configure scripts with the --enable-256-color switch, in addition you may also need to set your TERM environment variable to xterm-256color.

For bourne shells (bash, zsh, pdksh) this is done in ~/.profile:

set TERM xterm-256color; export TERM

Or for csh shells this is done in ~/.cshrc:

setenv TERM xterm-256color

See http://frexx.de/xterm-256-notes/ for more information about 256 colors on XTerm


To enable 256 colors in vim, put this your .vimrc before setting the colorscheme:

set t_Co=256

You may also need to add:

set t_AB=^[[48;5;%dm
set t_AF=^[[38;5;%dm

Your colors should at least look a little different. For full effect, use a colorscheme that supports 256 colors like desert256 (script#1243), inkpot (script#1143) or gardener (script#1348).

References

See Also