Color code for vi on terminal on Mac? I have been using my school's tux for a while. It was built with nice color code for each syntax for each programming languages. I want to do the same on the machine that I just purchased. When I invoke

vi filename


The view was plain black and white. How do I customize so that when I view the script/code files on terminal, it will have nice color code? For example, if statement will be read, string will be purple, etc. 
As far as I know, it may have something to do with .profile file?
Add the following to your ~/.vimrc:

filetype plugin indent on
set term=builtin_ansi
syntax on


If you’re using iTerm, use this instead of line 2:

set term=xterm-256color