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:
- Head to vim.org and download the following two archives:
- vim-5.7-rt.tar.gz
- vim-5.7-src.tar.gz
- Once downloaded, expand the archives as follows:
[robg]% gzip -d vim-5.7-rt.tar.gz
This 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
- We need to edit one of the header files before compiling. Navigate to vim-5.7/src/ and open feature.h in your favorite editor. Look for the line that reads #define SOME_BUILTIN_TCAPS and change it to read #define ALL_BUILTIN_TCAPS. Save your changes.
- Now it's time to finish, with the normal compilation trifecta. Make sure you're in /path/to/vim-5.7, and then:
[robg]% ./configure
[robg]% make
[robg]% sudo make install - When it's finished, type rehash and you should be able to launch VIM by typing vim at the terminal prompt. The application is installed in /usr/local/bin by default, with support files in /usr/local/share/vim/vim57.
- To get color-coded syntax highlighting, launch VIM and then type:
:set term=builtin_beos-ansi
If 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 onset 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
jpzr has also let me know that VIM will probably be available soon as a full graphic application for OS X. Keep checking vim.org for updates!