Vim Tips Wiki
m (Added to Syntax Category + code reformated)
m (Reverted edits by 208.168.231.74 (talk | block) to last version by 38.122.48.218)
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
  +
{{TipImported
{{review}}
 
{{Tip
 
 
|id=283
 
|id=283
  +
|previous=282
|title=Turn on syntax coloring in Mac OS X
 
  +
|next=284
|created=July 11, 2002 21:48
+
|created=July 11, 2002
 
|complexity=basic
 
|complexity=basic
 
|author=Mario Martinez
 
|author=Mario Martinez
 
|version=6.0
 
|version=6.0
 
|rating=153/70
 
|rating=153/70
  +
|category1=Mac OS X
|text=
 
  +
|category2=Syntax
This tip is actually for vim 6.1. To turn on syntax coloring in Mac OS X enter the following commands, or place them in your $HOME/.vimrc file.
 
:set term=builtin_beos-ansi
 
:syntax on
 
 
}}
 
}}
  +
Some versions of Mac OS X don't have syntax highlighting support in terminal Vim with default settings.
   
  +
If you don't have syntax highlighting in any Vim, first make sure something like this is in your .[[vimrc]]:
== Comments ==
 
Note that this is only an issue for vim in a Terminal window, not for the
 
GUI version, and that it will only work if support for beos-ansi is compiled in.
 
For pre-compiled versions for Mac OS X, see http://vim.sourceforge.net/download.php#mac
 
   
  +
<pre>
There are some further OS X FAQ's on my page, http://homepage.mac.com/fisherbb/index.html
 
  +
filetype plugin indent on
 
syntax on
  +
</pre>
   
  +
If you have that, and still don't get syntax highlighting in Vim running in a terminal (i.e. not a GUI like MacVim), you may need to inform Vim how to handle the terminal.
--Benji Fisher
 
   
  +
Something like this is needed, prior to the <code>syntax on</code> command in your .vimrc:
benji--AT--member.AMS.org
 
  +
<pre>
, July 12, 2002 10:44
 
 
set term=builtin_beos-ansi
----
 
  +
</pre>
On my installation (MacOS X 10.2.8), the term type was builtin_ansi. I added these to my .vimrc and all was well.
 
   
  +
Others (on "Mountain Lion") reported success with this instead:
Even the INSERT indicator now works as it does on my Linux systems.
 
   
  +
<pre>
James
 
  +
set term=builtin_ansi
  +
</pre>
   
 
==Comments==
james--AT--keeline.com
 
  +
set term=builtin_ansi Worked like a charm on OS X 10.9 Mavericks, Thanks.
, May 16, 2004 12:38
 
----
 
The ':syntax on' command works just fine for termtype 'xterm-color', at least under Panther.
 
   
  +
set term=xterm also works on OS X 10.9 Mavericks
mark.musante--AT--gmail.com
 
, June 30, 2004 9:50
 
----
 
'syntax enable' also works fine :)
 
   
  +
Disclaimer: Under 10.9 Mavericks with an external keyboard, term=builtin_ansi may make the delete key next to the end key change the character under the cursor rather than delete as expected. term=xterm has this key behave as expected.
steije--AT--spam.la
 
, August 14, 2005 14:23
 
----
 
<!-- parsed by vimtips.py in 0.584666 seconds-->
 
[[Category:Mac OS X]]
 
[[Category:Syntax]]
 

Revision as of 15:53, 22 January 2015

Tip 283 Printable Monobook Previous Next

created July 11, 2002 · complexity basic · author Mario Martinez · version 6.0


Some versions of Mac OS X don't have syntax highlighting support in terminal Vim with default settings.

If you don't have syntax highlighting in any Vim, first make sure something like this is in your .vimrc:

filetype plugin indent on
syntax on

If you have that, and still don't get syntax highlighting in Vim running in a terminal (i.e. not a GUI like MacVim), you may need to inform Vim how to handle the terminal.

Something like this is needed, prior to the syntax on command in your .vimrc:

set term=builtin_beos-ansi

Others (on "Mountain Lion") reported success with this instead:

set term=builtin_ansi

Comments

set term=builtin_ansi Worked like a charm on OS X 10.9 Mavericks, Thanks.

set term=xterm also works on OS X 10.9 Mavericks

Disclaimer: Under 10.9 Mavericks with an external keyboard, term=builtin_ansi may make the delete key next to the end key change the character under the cursor rather than delete as expected. term=xterm has this key behave as expected.