Getting Clojure Highlighting With Vim On Windows

Toralf Wit­tner wrote a good syn­tax file for Clo­jure but I had a hell of a time get­ting it to work on Win­dows, mostly because I’m not very smart and/or I didn’t bother to read the doc­u­men­ta­tion for Vim. So sue me. Regard­less, if you want to use Vim to edit Clo­jure scripts on Win­dows, save the file at the link above into your vimfiles/syntax folder and call it clojure.vim. The file­name isn’t impor­tant but it makes it easy to see what syn­tax files are what. I’m cur­rently just load­ing the file man­u­ally when I code in Clo­jure using :set ft=clojure and boom, you’ve got nice syn­tax highlighting.

You could prob­a­bly set this up to auto­mat­i­cally rec­og­nize .clj file­types and turn syn­tax high­light­ing on for those but I’m going to stick with this small vic­tory first. At least I learned SOMETHING today.

4 Comments

  • I pack­aged up Toralf’s syn­tax high­light­ing script and also pro­vided indent­ing and other file­type plu­gin spe­cific things for clo­jure. The whole pack­age is called Vim­Clo­jure and can be found at http://kotka.de/projects/clojure/vimclojure.html. Eg. it also takes care to auto­mat­i­cally set the clo­jure file­type, pro­vides com­ple­tion for clo­jure functions.….

    A side­note: the name of the file you put in the syntax/ direc­tory is *not* arbi­trary! In must be iden­ti­cal to the file­type you set with :set­file­type. So when you call your file­type foo­bar, the file must be named foobar.vim.

    Hope this gives a pleas­ant Clo­jure jour­ney in Vim.

    – Meikel

  • Scotch Drinker wrote:

    Thanks for the tip Meikel! I’ll give that a try tonight.

  • reviwhotels wrote:

    very int post.

  • porn site in amer­ica latex porn video

Leave a Reply

Your email is never shared.Required fields are marked *