Vim Tips Wiki
(on Snow leopard Colors are disabled)
(fix it up, merging comments as needed and removing dead link)
Line 11: Line 11:
 
|category2=Syntax
 
|category2=Syntax
 
}}
 
}}
  +
Some versions of Mac OS X don't have syntax highlighting support in terminal Vim with default settings.
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 [[vimrc]]:
 
  +
  +
If you don't have syntax highlighting in any Vim, first make sure something like this is in your .[[vimrc]]:
  +
 
<pre>
 
<pre>
  +
filetype plugin indent on
:set term=builtin_beos-ansi
 
:syntax on
+
syntax on
 
</pre>
 
</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.
==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
 
 
There are some further OS X FAQ's on my page, http://homepage.mac.com/fisherbb/index.html
 
 
----
 
'syntax enable' also works fine.
 
 
----
 
For Mountain Lion in vim use:
 
   
  +
Something like this is needed, prior to the <code>syntax on</code> command in your .vimrc:
 
<pre>
 
<pre>
:set term=builtin_ansi
+
set term=builtin_beos-ansi
:syntax on
 
 
</pre>
 
</pre>
   
  +
Others (on "Mountain Lion") reported success with this instead:
Or in your ~/.vimrc:
 
   
 
<pre>
 
<pre>
 
set term=builtin_ansi
 
set term=builtin_ansi
20 syntax on
 
 
</pre>
 
</pre>
   
 
==Comments==
----
 

Revision as of 15:04, 22 June 2013

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