I just followed Giles Goat Boy’s instructions for Vim OS X Clojure Syntax Highlighting, but there’s a bit of an improvement I’d like to throw out to the universe, and since there’s no comments over there, I’m posting it here.
The last step in his instructions is to sudo and edit /usr/share/vim/vimrc. You don’t have to do that. Create a file named ~/.vim/ftdetect/clojure.vim instead, and put this line in there:
au BufRead,BufNewFile *.clj set filetype=clojure
There you go. Now you don’t have to sudo and you aren’t editing for everyone on your computer.
Oh, and BTW, at least in OS-X, vi and vim are the same thing. Don’t believe me? Run ls -al `which vi` (note those are backticks, not single-quotes).
Related posts: