An Experiment In Scotch

I write to discover what I believe

Tag: vim

The Ultimate Vim Distribution and Local Bundles

I’ve been using The Ultimate Vim Distribution for over a year now and I love it. Because I use it mostly as configured out of the box, I struggle any time I have to update something. Today’s lesson in configuration is brought to you by the fact that I have finally broken down and decided I can’t avoid CoffeeScript anymore (mostly because the Node.js PluralSight video I’m working though uses it instead javascript – how many technologies can I reference in one post to try and get hits?). Out of the box, the vim distribution doesn’t have a plug-in for CoffeeScript syntax. However, it’s really easy to add it once you find one you like.

I picked the first one from a Google search for “vim coffeescript”, always a reliable way of choosing things in my experience. I followed the directions on adding local bundles but then got stuck when I tried to run :BundleInstall from within Vim. It seemed like it was ignoring it completely. After some floundering, the Windows hostage user (and this page) in me decided to restart Vim and restart it with “mvim +BundleInstall +BundleClean +q”. Presto chango, CoffeeScript syntax and indentation was enabled.

I found documentation for BundleInstall and BundleClean (“:h vundle” is your friend) but I have no idea what the +q does. Anyway, this post brought to you by the fact I couldn’t figure out how to fit it in 140 characters on Twitter. Also, I’m half toying with trying to do NaNoWriMo after a year layoff and I need to be writing a LOT more, nonfiction or otherwise.

Alternatively, I just learned about the :BundleInstall! (notice the bang on the end, Emeril would be proud) command. That can be run without restarting Vim. Yay. However, you’ll still have to restart Vim to get the syntax highlighting you’re looking for.

Getting Clojure Highlighting With Vim On Windows

Toralf Wittner wrote a good syntax file for Clojure but I had a hell of a time getting it to work on Windows, mostly because I’m not very smart and/or I didn’t bother to read the documentation for Vim. So sue me. Regardless, if you want to use Vim to edit Clojure scripts on Windows, save the file at the link above into your vimfiles/syntax folder and call it clojure.vim. The filename isn’t important but it makes it easy to see what syntax files are what. I’m currently just loading the file manually when I code in Clojure using :set ft=clojure and boom, you’ve got nice syntax highlighting.

You could probably set this up to automatically recognize .clj filetypes and turn syntax highlighting on for those but I’m going to stick with this small victory first. At least I learned SOMETHING today.