LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 10: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, 10:43 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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 10:46 AM.
 
Old 02-06-2008, 10: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, 10:59 AM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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, 08:36 PM   #5
roy_lt_69
Member
 
Registered: Aug 2006
Location: Vancouver, BC, Canada
Distribution: Slackware, Mint, Debian
Posts: 238

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:09 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
Open Source Consulting | Domain Registration