The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > OS X (Apple)
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
what is the right syntax ?? convenientstore Shell Programming and Scripting 7 06-04-2007 01:21 AM
csh syntax charlie11k UNIX for Dummies Questions & Answers 0 05-31-2007 11:29 PM
Help with the syntax chandhar Shell Programming and Scripting 2 03-26-2007 04:38 AM
Help with the syntax chandhar Shell Programming and Scripting 2 03-25-2007 10:48 PM
What does this syntax mean... DrAwesomePhD UNIX for Dummies Questions & Answers 1 07-31-2006 08:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-2007
Registered User
 

Join Date: Nov 2004
Location: Poland
Posts: 33
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-30-2007
dlundh's Avatar
Registered User
 

Join Date: Apr 2007
Location: Stockholm, Sweden
Posts: 19
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
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.
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 03:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102