Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-24-2006, 08:59 AM   #1
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 74

Rep: Reputation: 15
How can i make Vim work in 256 color mode ?

Serching some info about scripting i found this page:
which has more than 100, 256 color schemes for vim.

I searched the net on how to make my vim 256 and here's the guide i followed:


A way to add xterm with 256 colors in Debian:

* To know how many colors xterm has:
strings /usr/X11R6/bin/xterm | grep ^color[0-9] | sort -tr +1 -n

* Create a directory e.g. "build"
* cd build
* apt-get source xterm
* apt-get build-dep xterm
* untar sources
* for i in debian/patches/* ; do patch -p0 < "$i" ; done
* cd xc/programs/xterm
* chmod +x configure
* ./configure --with-x --enable-256-color --enable-wide-chars --disable-freetype
* make
* make install
* install debian package ncurses-term (which contains the file
* set TERM=xterm-256color
* Use perl script to check colors:
(google it if it isn't in your system)

-- Ivan F. Villanueva B. --


I had a mising library at compile point, but i was able to find it with apt-get. So i finished with out errors, but i still have 16 colors in my term.

Any ideas why ?
Old 01-26-2006, 03:10 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Ok, you installed the colors. Now, did you tell vim to use them? Like, editing a vimrc or something.
Old 01-26-2006, 04:21 AM   #3
LQ Newbie
Registered: Apr 2005
Location: Bangalore
Posts: 16

Rep: Reputation: 0
Hi, i am using fedora core 3. So does vim come with 256 colors in FD3? what should i do to test different colors?

Old 01-26-2006, 06:17 AM   #4
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
The on line help in vim will tell you how to do this.

Start vim.

Press the F1 key.

Scroll down to the "Getting Started" section.

Keep scrolling down until you get to the line with
|usr_06.txt| Using syntax highlighting

Move the cursor right one column so that it is in between the | characters.

Press the control key and the ] key at the same time.

Read about using color schemes.
Old 01-30-2006, 09:14 PM   #5
Registered: Oct 2004
Distribution: Debian, Ubuntu
Posts: 74

Original Poster
Rep: Reputation: 15
I apologise for the lack of information in my first post. As i said before I followed every step of the guide without much trouble.

I also changed the line in my vimrc from set t_Co=16 to set t_Co=256 and got no results. Then i realised i was not using xterm, i was using konsole.

I switched to xterm and tried the perl color test ( and i got all 256 colors on screen, i also tried the colortest.vim with vim and got all the colors.

But, when i type strings /usr/X11R6/bin/xterm | grep ^color[0-9] | sort -tr +1 -n , i still get 16 colors. Maybe it has something to do with set TERM=xterm-256color , im not sure where to use that line.

Besides i can't get the color schemes to show the colors correctly. They should recognice the color names in /usr/X11R6/lib/X11/rgb.txt but they don't. They only show the colors that have simple names like lightblue, red, darkgreen, etc.

So the question are,
why isn't vim recognicing the colors in the color schemes ?
how do i tell konsole to use 256 colors ?

Last edited by landuchi; 01-30-2006 at 09:45 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
80x25 256 color? coldsalmon Linux - General 2 03-24-2005 03:56 PM
How to do a 256 color in wine hkl8324 Linux - Software 0 02-08-2005 08:21 PM
I need to get out of 256 color mode in slack vdogvictor Linux - Newbie 3 05-18-2004 10:05 PM
win4lin, 256 color mode possible? calimer Linux - Software 3 11-22-2003 03:59 PM
how to make my linux box work at 32 color depth? NeoAnderson Linux - Software 2 07-30-2002 03:20 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration