vim syntax highlighting

Can anyone tell me a good guide on how to add syntax highlighting to vim (specifically for apple osx but I guess it much the same for any platform).
Who is Participating?
JackNaifConnect With a Mentor Commented:
First of all try downloading and installing the newest version. (6 something)
Just as ADSaunders mentioned, it's got syntax highlighting built in.

Now if it doesn't highlight what you're editing (or even before you go into the hassle of downloading it and installing it, with whatever version you're using), try typing   <Esc>:syntax on

Or try:

<Esc>:help syn-qstart


<Esc>:help syntax

The built-in help has quite a lot of info on this.


See, vim now has syntax highlighting built in.

regards .. Alan
ADSaundersConnect With a Mentor Commented:
See this link to see how to turn it on.

.. Alan
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Also, you can use gvim, and simply use the syntax menu to highlight.
scanadminConnect With a Mentor Commented:
press esc,

type :syntax enable

to make this permenant, make a file in your home directory called ".vimrc"

then add the string ":syntax enable" in there
if it is gVim, goto syntax -> automatic in the memu bars
paranoidcookieAuthor Commented:
Thanks all I ran

:syntax enable

but it dosnt highlight any of my sample c prog I guess im missing something I used to use red hat and all the higlighting was done by default.

I have a .viminfo file is that the same as .vimrc
no, a .vimrc file contains your settings options in there,

there are loads of settings (check vim website) and you can add them into this file to by set everytime you load vim
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.