Clojure Syntax Highlighting in OS-X vi

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:

  1. Accidental Syntax
  2. Extending Java Syntax
This entry was posted in Code Samples. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • http://kotka.de/projects/clojure/vimclojure.html Meikel Brandmeyer

    And I’d like to add, that this file already comes with VimClojure…

  • Categories