Automatically fold Clojure methods in Vim

August 11, 2010

I’ve been trying to get this working for quite some time, I finally have a semi-working function to fold Clojure methods automatically.

First, here’s a picture of what you can expect to see when using this (click for larger version):

Click me!

And here’s the code (stick this in your .vimrc):

That’s it, easy as pie, enjoy the folding for Clojure files.

There are a few bugs with this because I’ve never actually written a Vim plugin, so I kind of hacked my way through this until I got it working. I welcome any feedback from someone with vimscript development experience (I’m looking at you Brian Carper ;))

tags: , ,
posted in clojure, folding, vim by Lee

Follow comments via the RSS Feed | Leave a comment | Trackback URL

2 Comments to "Automatically fold Clojure methods in Vim"

  1. How I develop Clojure with Vim : :wq – blog wrote:

    […] 2: Want to automagically fold Clojure methods when using Vim? Check out this post. Share and […]

  2. Nick wrote:

    I just discovered this and I think it’s fantastic. Just wanted to say “Thanks” for this little nugget of gold. :)

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org