VIM ('Vi IMproved') is a replacement for vi that features a ton of enhancements, including colored syntax highlighting for a number of languages (Java, C/C++, HTML, PHP, PERL, etc) and the ability to save edited files as HTML with syntax colors. If you like using vi, you'll love VIM. Thanks to macosxhints reader jpzr, a friend from Poland, for the information on how to get this working! I followed his tips, tweaked a couple of things, and installed it with no problems.
Read the rest of this article if you'd like the step-by-step instructions on installing VIM for OS X. NOTE: You need to have the developer tools installed to compile VIM, and you should be fairly comfortable in the terminal ... then again, if you're using vi, you're probably quite comfortable in the terminal!
To compile VIM for OS X, follow these steps:
[robg]% gzip -d vim-5.7-rt.tar.gzThis will insure that everything winds up in the proper directories for the next steps.
[robg]% tar xvf vim-5.7-rt.tar
[robg]% gzip -d vim-5.7-src.tar.gz
[robg]% tar xvf vim-5.7-src.tar
[robg]% ./configure
[robg]% make
[robg]% sudo make install
:set term=builtin_beos-ansiIf you'd like VIM to launch in this mode all the time, you'll need a .vimrc file in your home directory which contains those two lines (without the colons, since they're the VIM command prompt). The .vimrc can be quite complex, of course. Here's jpzr's actual file:
:syntax on
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/macros/explorer.vimĀ
set selectmode=mouse
set backupdir=/tmp
set directory=/tmp
set guifont=Lucida_Console:h8
set guioptions-=T
set errorfile=/tmp/rutkowsk.errors.log
set ic
set grepprg=grep -n
set fileformats=dos,unix,mac
highlight StatusLineNC guifg=#ff0000 guibg=#000000
highlight StatusLine guifg=#00ff00 guibg=#000000
set hls
hi Normal guibg=black guifg=white
hi Search guibg=white guifg=black
hi IncSearch guibg=white guifg=black
set tags=./tags
set mousef
set term=builtin_beos-ansi
syntax on
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010421114134645