LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 02-06-2008, 11:31 AM   #1
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
vi or vim doesn't have color coding (highlighting) for c??


Good Day,

I am using vim 7.1 on suse10.3.
vim doesn't highlight c code? I have used redhat and FC before never had that issue before.

Any Ideas?

Thanks.
 
Old 02-06-2008, 11:43 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
That could be just a distribution default setting. Add something like this to your ~/.vimrc to turn syntax highlighting on:
Code:
:syntax on
:colorscheme zombie
You can find colorscheme names in either /opt/kde3/share/vim/vim62/colors/ or /usr/share/vim/vim63/colors/. Use the colorscheme name without the .vim extension.

You can get more in-depth explanation here: http://www.vim.org/htmldoc/syntax.html.

Last edited by bigrigdriver; 02-06-2008 at 11:46 AM.
 
Old 02-06-2008, 11:51 AM   #3
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Original Poster
Rep: Reputation: 33
^Thanks.
/usr/share/vim/vim71/colors
is empty plus I use gnome.

I only have
.viminfo
in my home dir.
 
Old 02-06-2008, 11:59 AM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
First, in a console try 'locate .vim' in case the colorschemes are located elsewhere.

Second, you can create the .vimrc in your home directory.

Here's a link to the vim documentation. http://www.vim.org/htmldoc/

For examples of .vimrc files, point your browser at www.google.com/linux and search for vimrc examples.
 
Old 02-06-2008, 09:36 PM   #5
roy_lt_69
Member
 
Registered: Aug 2006
Location: Vancouver, BC, Canada
Distribution: Slackware, Bodhi, Mepis, AntiX, Mint
Posts: 172

Rep: Reputation: 21
You can create a .vimrc file using the following command within vim itself:
:mkvimrc.
 
  


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
[SOLVED] vim without syntax highlighting lord_didger Debian 5 11-18-2006 02:29 PM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 12:08 PM
vim php color coding? Longinus Linux - Software 4 04-11-2004 06:56 AM
vim color highlighting new_user10 Programming 9 11-02-2003 01:40 PM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 03:39 AM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
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