vim and syntax max os

Hi
how to color syntax in terminal in OS X ?

I wrote in .vimrc:
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
syntax on

and no results.
Best regards

My mac is inaccesible to me right now but try this:
# How do I get colors in Terminal vim?
Update: I think this is only a problem for Mac OS X versions 10.0 and 10.1.
According to Rajesh Duggal, the termcap database that comes with Mac OS X is incorrect. There are two solutions: you can edit the termcap database (which requires superuser privileges) or you can add some extra lines to your vimrc (or other startup) file. Another theory is that the right terminal type for Terminal.app is Beos-Ansi.

  1. (Rob Griffiths) Try
    :set term=builtin_beos-ansi
    This requires that your version of vim was compiled with support for this terminal type. If it works, add a line like this (with or without the leading : character) to your vimrc file. For further details, see Mac OS X Hints.
    On Mac OS X 10.2 (Jaguar), :set term=ansi may work better. I have some reports that builtin_beos-ansi works and some reports that it does not. Both work for me, but with different colors.

  2. (Rajesh Duggal) Edit the termcap database:

    1. % sudo vim /usr/share/misc/termcap

    2. Add the second of these lines between the other two, which should already be there:

      d0|vt100|vt100-am|vt100am|dec vt100:\\
      	:Co\#8:Sf=\\E[3%dm:Sb=\\E[4%dm:\\
      	:do=^J:co\#80:li\#24:cl=\\E[;H\\E[2J:sf=2*\\ED:\\
      
    3. Reconstruct the database with

      $ sudo cap_mkdb /usr/share/misc/termcap
      
    4. Quit and restart Terminal, and you'll pick up the new termcap entry.

  3. (Jens Vagelpohl) Add lines something like the following to your vimrc file:

    if !has\("gui"\) && has\("terminfo"\)
      set t_Co=16
      set t_AB=^[[%?%p1%\{8\}%<%t%p1%\{40\}%\+%e%p1%\{92\}%\+%;%dm
      set t_AF=^[[%?%p1%\{8\}%<%t%p1%\{30\}%\+%e%p1%\{82\}%\+%;%dm
    else
      set t_Co=16
      set t_Sf=^[[3%dm
      set t_Sb=^[[4%dm
    endif
    

    Note that "^[" should be replaced by a raw Escape character.