There is currently a TextMate bundle in process for the templating language, Haml. It doesn’t come built-in, however. Installation is fairly simple once you figure it out.

(Keep in mind, my TextMate application location may vary from yours. This is simply what I found works for me.)

First, browse to your bundles area in Terminal. You may need to create some of these directories on your system.

cd ~/"Library/Application Support/TextMate/Pristine Copy/Bundles/"

Then check out the TextMate bundle from MacroMates' bundle repository:

svn co "http://svn.textmate.org/trunk/Bundles/Ruby Haml.tmbundle"

Or if you prefer git:

git clone git://github.com/textmate/ruby-haml.tmbundle.git

Then, reload your bundles in TextMate (Bundles | Bundle Editor | Reload Bundles).

Finally, for some reason tabbing isn’t set properly by default when editing a Haml file, which is important for this white-space-aware templating language. Perhaps the expectation is that you will always use your space bar? In any case, after opening a .haml file, look along the bottom bar of the TextMate interface. Be sure the Haml bundle is selected, and change your tabbing to Soft Tabs at 2 spaces per tab.

Haml tabbing

Update: Here are instructions for installing the Sass TextMate bundle:

cd ~/"Library/Application Support/TextMate/Pristine Copy/Bundles/"
svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby Sass.tmbundle"

For both the Haml and Sass bundles, you may prefer to install the bundles in your “personalized” bundle area. Simply replace the cd commands above with:

May 30, 2007 · Subscribe · Archive · Projects · Twitter · GitHub · Flickr