LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-24-2006, 07:59 AM   #1
landuchi
Member
 
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:
http://www.cs.cmu.edu/~maverick/VimC.../index-pl.html
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
usr/share/terminfo/x/xterm-256color)
* set TERM=xterm-256color
* Use perl script to check colors:
perl 256colors2.pl
(google it if it isn't in your system)

-- Ivan F. Villanueva B. --

http://vim.sourceforge.net/tips/tip.php?tip_id=827

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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, 02:10 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,764

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Ok, you installed the colors. Now, did you tell vim to use them? Like, editing a vimrc or something.
 
Old 01-26-2006, 03:21 AM   #3
sateeshgalla
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?

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

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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, 08:14 PM   #5
landuchi
Member
 
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 (256color2.pl) 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 08:45 PM.
 
  


Reply


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 02:56 PM
How to do a 256 color in wine hkl8324 Linux - Software 0 02-08-2005 07:21 PM
I need to get out of 256 color mode in slack vdogvictor Linux - Newbie 3 05-18-2004 09:05 PM
win4lin, 256 color mode possible? calimer Linux - Software 3 11-22-2003 02:59 PM
how to make my linux box work at 32 color depth? NeoAnderson Linux - Software 2 07-30-2002 02:20 PM


All times are GMT -5. The time now is 12:09 PM.

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