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://macromates.com/svn/Bundles/trunk/Bundles/Ruby Haml.tmbundle"

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 (13)

  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 #

Trackback/Pingback (1)

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

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