Fork me on GitHub

Installing HAML bundle for TextMate


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.

cd /Applications/TextMate.app/Contents/SharedSupport/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 /Applications/TextMate.app/Contents/SharedSupport/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:

cd ~/"Library/Application Support/TextMate/Bundles/"
Share if you like:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Technorati
  • Ma.gnolia
  • Reddit
  • description
Related posts:

Comments (18)

  1. thomaskay wrote:

    Fantastic. I already had the bundle installed, but I just hadn’t realised that tabbing could be changed that easily.

    Thursday, June 7, 2007 at 2:05 am #
  2. bitbutter wrote:

    I had to checkout with the following url: svn co “http://macromates.com/svn/Bundles/trunk/Bundles/Ruby Haml.tmbundle”

    Friday, September 7, 2007 at 1:17 pm #
  3. borafina wrote:

    I see the Ruby Haml. tmbundle but when I try it, I get:

    svn: URL ‘http://macromates.com/svn/Bundles/trunk/Bundles/Haml.tmbundle’ doesn’t exist

    Is the space causing the issue? Thanks.

    Thursday, September 20, 2007 at 12:03 pm #
  4. borafina wrote:

    Oops…forgot to add the quotes. Thanks.

    Thursday, September 20, 2007 at 12:05 pm #
  5. Barry wrote:

    Fantastic. Haml away everyone!

    Thursday, September 20, 2007 at 12:16 pm #
  6. Carl Mercier wrote:

    For clarity, please update the article to reflect the new url:

    http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20Haml.tmbundle/

    Tuesday, September 25, 2007 at 1:43 pm #
  7. There’s an easier way :)

    sudo gem install bundlemate bundlemate install “Ruby Haml” bundlemate install “Ruby Sass”

    :)

    Thursday, January 10, 2008 at 7:03 pm #
  8. Ivan wrote:

    Worked perfect.

    Color changes everything!

    Friday, July 4, 2008 at 11:20 am #
  9. Jeff wrote:

    Arrgh. What happened to the Sass bundle?

    “The requested URL /svn/Bundles/trunk/Bundles/Ruby Sass.tmbundle was not found on this server.”

    Monday, November 3, 2008 at 12:46 pm #
  10. Barry wrote:

    That stinks, Jeff. It indeed appears to be gone.

    Aussiegeek’s github project looks like a promising mirror.

    Monday, November 3, 2008 at 12:53 pm #
  11. Henrik N wrote:

    The Sass bundle is in the Review section:

    svn co "http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby%20Sass.tmbundle/"
    

    Tuesday, November 11, 2008 at 7:13 am #
  12. Henrik N wrote:

    Watch out for those fancy quotes.

    Tuesday, November 11, 2008 at 7:13 am #
  13. Barry wrote:

    Thanks, Henrik. I’ve updated the post with the new bundle location.

    Tuesday, November 11, 2008 at 7:48 am #
  14. sanbit.com wrote:

    Great, I just installed it, works nice, it was hard to use before the bundle.

    Thursday, February 5, 2009 at 8:04 pm #
  15. Rumble wrote:

    Just installed the bundles - makes a big difference when coding HAML and SASS in Textmate, so many thanks for the info.

    Wednesday, April 1, 2009 at 2:57 pm #
  16. Andy wrote:

    Thanks Barry. I normally install TM bundles using the gem here http://tinyurl.com/cmqfro, however it is not working at the moment so I used your method and put it into a gist: http://gist.github.com/89632

    Thursday, April 2, 2009 at 11:20 pm #
  17. Zhifeng Koh wrote:

    Hi, I believe the url should now be:

    http://svn.textmate.org/trunk/Bundles/Ruby%20Haml.tmbundle/

    Thursday, July 2, 2009 at 2:15 pm #
  18. Barry wrote:

    Yes, the URL appears to have changed. And now that many Textmate bundles are available at GitHub, I’ve added instructions for git.

    Thursday, July 2, 2009 at 3:03 pm #

Trackbacks/Pingbacks (3)

  1. Suave’s Blog » » use Haml in Textmate on Friday, December 7, 2007 at 5:11 am

    [...] 可以参考下这篇blog [...]

  2. [...] The TextMate Manual, Bundles Chapter Installing HAML bundle for TextMate [...]

  3. Sequence Mediaworks Blog » Installing the Haml bundle for TextMate on Wednesday, February 25, 2009 at 1:14 pm

    [...] This is more for my benefit of forgetting how to install the Haml bundle for TextMate. (Surreptitiously borrowed from Barry Hess’ blog entry.) [...]