Apr 21, '01 11:41:34AM • Contributed by: robg
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:
- Once downloaded, expand the archives as follows:
[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
- 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]% 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-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:
set grepprg=grep -n
highlight StatusLineNC guifg=#ff0000 guibg=#000000
highlight StatusLine guifg=#00ff00 guibg=#000000
hi Normal guibg=black guifg=white
hi Search guibg=white guifg=black
hi IncSearch guibg=white guifg=black
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!