<?xml version='1.0' encoding='utf-8' ?>
<rss version='2.0' xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <channel>
    <title>Wolfmans Howlings: A HAML edit mode for JEdit</title>
    <link>http://blog.wolfman.com/articles/2006/12/1/a-haml-edit-mode-for-jedit</link>
    <description>A programmers Blog about Ruby, Rails and a few other issue</description>
    <language>en-us</language>
    <ttl>40</ttl>
    <item>
      <title>A HAML edit mode for JEdit</title>
      <description>
        &lt;p&gt;I've just started a new RoR project and thought I'd try out
        &lt;a href=&quot;http://haml.hamptoncatlin.com/&quot;&gt;HAML&lt;/a&gt; for the views instead of rhtml.&lt;/p&gt;
        
        &lt;p&gt;Seeing as I just switched to JEdit, I looked for a HAML language mode,
        and to my surprise no one had done one yet.&lt;/p&gt;
        
        &lt;p&gt;So here is my first attempt at a language mode for JEdit and version
        1.0 of the HAML language mode. It needs more work, and I hope someone
        with a better understanding of JEdit language modes will help out.&lt;/p&gt;
        
        &lt;p&gt;This will set the indent to 2 spaces and auto-indent after a %tag that
        has nothing else on the line...&lt;/p&gt;
        
        &lt;pre&gt;&lt;code&gt;%p
          stuff
        &lt;/code&gt;&lt;/pre&gt;
        
        &lt;p&gt;It will not auto indent if there is more stuff on the line like in the
        following example the line after &lt;code&gt;%p&lt;/code&gt; gets indented but the line
        after &lt;code&gt;%label&lt;/code&gt; does not.&lt;/p&gt;
        
        &lt;pre&gt;&lt;code&gt; %p
            %label{ :for =&amp;gt; &quot;login&quot; }Login
            %br/
            = f.text_field :login
        &lt;/code&gt;&lt;/pre&gt;
        
        &lt;p&gt;I have setup a basic syntax coloring scheme that should color &lt;code&gt;%tags&lt;/code&gt;
        and &lt;code&gt;.classes&lt;/code&gt; and &lt;code&gt;#ids&lt;/code&gt; differently. It will color anything
        following an &lt;code&gt;=&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt; and defer the syntax highlighting to the ruby
        mode for anything following them, ditto for anything inside &lt;code&gt;{ }&lt;/code&gt;.&lt;/p&gt;
        
        &lt;p&gt;Feedback and better ideas are welcome.&lt;/p&gt;
        
        &lt;p&gt;Download from &lt;a href=&quot;http://blog.wolfman.com/files/haml.xml&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
        
        &lt;p&gt;To install copy the file to ~/.jedit/modes, and edit the catalog file
        in that directory and add this line:&lt;/p&gt;
        
        &lt;pre&gt;&lt;code&gt;&amp;lt;MODE NAME=&quot;haml&quot; FILE=&quot;haml.xml&quot; FILE_NAME_GLOB=&quot;*.haml&quot; /&amp;gt;
        &lt;/code&gt;&lt;/pre&gt;
        
        &lt;p&gt;Then restart jedit, and your haml files will be syntax highlighted.&lt;/p&gt;
        
        &lt;p&gt;I like HAML but there simply is not enough example code out there
        yet, so here are two simple conversions from well know rhtml files
        into HAML...&lt;/p&gt;
        
        &lt;p&gt;First the standard login form from &lt;code&gt;acts_as_authenticated&lt;/code&gt;&lt;/p&gt;
        
        &lt;pre&gt;&lt;code&gt;- form_tag sessions_path do
          %p
            %label{ :for =&amp;gt; &quot;login&quot;} Login
            %br/
            = text_field_tag 'login'
        
          %p
            %label{ :for =&amp;gt; &quot;password&quot; }Password
            %br/
            = password_field_tag 'password'
        
          %p
            %label{ :for =&amp;gt; &quot;remember_me&quot; }Remember me:
            = check_box_tag 'remember_me'
        
          %p
            = submit_tag 'Log in'
        &lt;/code&gt;&lt;/pre&gt;
        
        &lt;p&gt;Next the new user form from the same place...&lt;/p&gt;
        
        &lt;pre&gt;&lt;code&gt;= error_messages_for :user
        
        - form_for :user, :url =&amp;gt; users_path do |f|
          %p
            %label{ :for =&amp;gt; &quot;login&quot; }Login
            %br/
            = f.text_field :login
          %p
            %label{ :for =&amp;gt; &quot;email&quot; }Email
            %br/
            = f.text_field :email
        
          %p
            %label{ :for =&amp;gt; &quot;password&quot; }Password
            %br/
            = f.password_field :password
        
          %p
            %label{ :for =&amp;gt; &quot;password_confirmation&quot; } Confirm Password
            %br/
            = f.password_field :password_confirmation
        
          %p
            = submit_tag 'Sign up'
        &lt;/code&gt;&lt;/pre&gt;
        
        &lt;p&gt;If this is dumb HAML coding please let me know how to improve it :)&lt;/p&gt;
        
        &lt;p&gt;&lt;a href=&quot;http://technorati.com/tag/jedit+haml&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;
        &lt;a href=&quot;http://technorati.com/tag/jedit+rails+haml&quot; rel=&quot;tag&quot;&gt;&lt;/a&gt;&lt;/p&gt;
      </description>
      <author>Jim Morris</author>
      <pubDate>Fri, 01 Dec 2006 18:09:47 -0800</pubDate>
      <link>http://blog.wolfman.com/articles/2006/12/1/a-haml-edit-mode-for-jedit</link>
      <guid isPermaLink='false'>urn:uuid:51935488-ce66-4902-bfd7-b77acc710b0f</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Frederick</title>
      <description>Hey, I've been looking for this. Thanks a lot for sparing me the pain of constructing an edit mode myself. Although I might have some energy to put into helping you improve it in the future. Seeing as I'm stuck with jEdit for some time before I earn enough money to go buy a Mac and use TextMate, I'm happy that at least now it's a bit more bearable.</description>
      <pubDate>Sat, 20 Jan 2007 22:00:02 -0800</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-75</link>
      <guid isPermaLink='false'>urn:uuid:473a2213-01c4-4d9d-a54d-0181cb73b654</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Xarc</title>
      <description>
        haml.xml doesn't exist...
        'Page not found'
      </description>
      <pubDate>Wed, 11 Jul 2007 06:51:21 -0700</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-76</link>
      <guid isPermaLink='false'>urn:uuid:605ff793-0b47-41e1-876e-6f1bc785d4ff</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Xarc</title>
      <description>
        Sorry for repeat. i find the correct URL:
        http://haml.googlegroups.com/web/haml.xml
      </description>
      <pubDate>Wed, 11 Jul 2007 06:56:58 -0700</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-77</link>
      <guid isPermaLink='false'>urn:uuid:6a18077e-f85c-4487-bb2c-079a5ec50637</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by wolfmanjm</title>
      <description>Thanks I fixed the link</description>
      <pubDate>Wed, 11 Jul 2007 11:46:54 -0700</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-78</link>
      <guid isPermaLink='false'>urn:uuid:e5c96224-0ed3-4297-b36f-c82d9c1a8f32</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Gabriel Medina</title>
      <description>
        Thanks a lot for your work.
        
        It's great. Just what I needed.
      </description>
      <pubDate>Thu, 02 Oct 2008 02:06:28 -0700</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-79</link>
      <guid isPermaLink='false'>urn:uuid:7076e2d3-7204-4103-ac8d-d5227248741d</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Gabriel Medina</title>
      <description>
        Hi there, I was inspired by your HAML jedit mode, and wrote a SASS mode myself,
        it's here: 
        
        [SASS jEdit Mode for Syntax Highlighting](http://rha7dotcom.blogspot.com/2008_10_02_archive.html)
        
        Hope this is useful for you.
        
        Gabriel Medina
      </description>
      <pubDate>Thu, 02 Oct 2008 04:39:29 -0700</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-80</link>
      <guid isPermaLink='false'>urn:uuid:b0e16fe1-e505-40f5-ab9e-5afd24d2d7b3</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Jesse</title>
      <description>
        If you're wondering why the buffers you had open still don't work, maybe even after you've closed them and reopened them, it's because jedit saves buffer options per file even after you close.  
        
        To change it, go to Utilities-&gt;Buffer Options-&gt;Edit mode
        
        New files will open and use the modes just fine.
      </description>
      <pubDate>Mon, 01 Mar 2010 13:32:54 -0800</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-315</link>
      <guid isPermaLink='false'>urn:uuid:83a0cb2b-f179-4767-b7f7-b5adba275b77</guid>
    </item>
    <item>
      <title>"A HAML edit mode for JEdit" by Jesse</title>
      <description>
        If you're wondering why the buffers you had open still don't work, maybe even after you've closed them and reopened them, it's because jedit saves buffer options per file even after you close.  
        
        To change it, go to Utilities-&gt;Buffer Options-&gt;Edit mode
        
        New files will open and use the modes just fine.
      </description>
      <pubDate>Mon, 01 Mar 2010 13:32:58 -0800</pubDate>
      <link>http://blog.wolfman.com/posts/20#comment-316</link>
      <guid isPermaLink='false'>urn:uuid:52821364-ef5e-405f-b61d-209039d8cd63</guid>
    </item>
  </channel>
</rss>
