How do I run VI with colors on Lion?

Solution 1:

It’s a matter of having the right settings in your ~/.vimrc file. Here’s mine: https://github.com/mathiasbynens/dotfiles/blob/master/.vimrc.

The key is to add this:

" Enable syntax highlighting
syntax on

You can install color schemes in your ~/.vim/colors directory. To enable a colorscheme, use:

" Select a colorscheme
colorscheme molokai

I’m using Molokai, which looks like this when editing a JavaScript file:

Solution 2:

I'll also say that MacVim is a nice upgrade from the standard Vim that ships with OS X, but it isn't necessary. What you need is Vim configuration that adds syntax highlighting to VIM.

The fastest way to get that is with Janus -- it's a set of VIM plugins and configuration files pre-configured and ready to go. It works with Vim and MacVim.

To install it:

curl -Lo- http://bit.ly/janus-bootstrap | bash

And then follow the instructions. That calls their automatic installer. It requires Vim 7.3 or greater. You'll get an easy path to colours and plugins in Vim.

Vim with Janus