Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Vim syntax highlighting in Mac OS X terminal

0 views
Skip to first unread message

Matthew S. Shields

unread,
Aug 6, 2001, 2:17:17 PM8/6/01
to
As the title says, has anyone had any luck getting syntax highlighting to work with the terminal that comes with Mac OS X. I have compiled the latest version of Vim and copied my vimrc file but no joy. I have had no problem with other unices before (Solaris, Irix, Linux). I know the terminal is colour because I have "ls" in colour. Any ideas out there? Thanks Matt Matthew S. Shields BSc (hons), PhD student Parallel and Scientific Computation Group, Dept of Computer Science Cardiff University http://www.cs.cf.ac.uk/User/M.S.Shields/ M.S.Shields@(cs.cf.ac.uk|usa.net) ICQ# 99023784

David Mankin

unread,
Aug 7, 2001, 4:26:56 AM8/7/01
to
Matthew S. Shields <M.S.S...@cs.cf.ac.uk> wrote:

> As the title says, has anyone had any luck getting syntax highlighting
> to work with the terminal that comes with Mac OS X. I have compiled the
> latest version of Vim and copied my vimrc file but no joy. I have had no
> problem with other unices before (Solaris, Irix, Linux). I know the
> terminal is colour because I have "ls" in colour.
>
> Any ideas out there?
>
> Thanks Matt

I've had this piece of code in my .vimrc on various machines for years.
I've never actually tried to figure out what it does, but it seems to
make the difference as to whether I color hilighting works.
--------------------
:if 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
syntax on
--------------------
The four "^[" symbols are literal escape characters in the file. Type
control-V ESC to insert them.

I'm hapily using this on OS X now, though I had to invert the terminal
colors so it's white on black. Otherwise I can't read vim's cyan and
yellow which it likes to use all over the place.

Does anybody know how to change the "ANSI" colors so that what Terminal
thinks is Cyan is still readable on white?

Hope this helps,
-David Mankin
Email: my last name (see above) <at> yahoo.com

Matthew S. Shields

unread,
Aug 7, 2001, 10:55:05 AM8/7/01
to
Thanks worked a treat. I had something similar in my old vimrc but obviously not quite right for Mac OS X. Cheers Matt Matthew S. Shields BSc (hons), PhD student Parallel and Scientific Computation Group, Dept of Computer Science Cardiff University http://www.cs.cf.ac.uk/User/M.S.Shields/ M.S.Shields@(cs.cf.ac.uk|usa.net) ICQ# 99023784
0 new messages