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:

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments (23)

  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 #
  19. Any idea why color coding wouldn’t show up for me? I definitely have the bundle selected in the edit window.

    Comments are colored, but tag names (%div) are just plain.

    Kevin

    Wednesday, October 7, 2009 at 10:45 am #
  20. Barry wrote:

    @Kevin Not sure. Here’s what the Haml template file (shipped with the plugin) helpful.haml looks like in my TextMate:

    helpful.haml 2014 scrawlers

    Wednesday, October 7, 2009 at 4:26 pm #
  21. Steve Ringo wrote:

    @Kevin:

    I had the same problem. Try change your colour theme. I was using vibrant ink, and there was no syntax colouring. When I switched to cobalt, it came out.

    Steve

    Thursday, October 22, 2009 at 4:19 am #
  22. Barry wrote:

    Thanks for the tip, @Steve!

    Note: In my screenshot, I’m using the great Railscasts theme by Ryan Bates.

    Thursday, October 22, 2009 at 8:09 am #
  23. m3talsmith wrote:

    Still relevant. Thanks!

    Just a quote update, they moved the svn repo again for the sass bundle:

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

    Thursday, December 10, 2009 at 10:47 am #

Trackbacks/Pingbacks (4)

  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.) [...]

  4. [...] found this article that describes the installation of the TextMate Haml [...]


Fatal error: Cannot redeclare class services_json in /home/bjhess/bjhess.com/blog/wp-includes/class-json.php on line 115