How to syntax highlight Rails 2.0 .html.erb files in Textmate/E-texteditor

203 views
Skip to first unread message

Jesper Rønn-Jensen

unread,
Oct 10, 2007, 9:35:52 AM10/10/07
to Ruby on Rails: Talk
I'm using E-texteditor that reads and understand the macromates
bundles just fine.

But how do you set up your editor so that it correctly can
identify .html.erb as "HTML (Rails)" in Textmate?

It seems as the bundle is not yet updated.
http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20on%20Rails.tmbundle/Syntaxes/HTML%20(Rails).plist

What do you do to syntax highlight correctly?


Related posting at the E-texteditor forum/bundles thread
http://www.e-texteditor.com/forum/viewtopic.php?t=1711

Frederick Cheung

unread,
Oct 10, 2007, 9:53:50 AM10/10/07
to rubyonra...@googlegroups.com

On 10 Oct 2007, at 14:35, Jesper Rønn-Jensen wrote:

>
> I'm using E-texteditor that reads and understand the macromates
> bundles just fine.
>
> But how do you set up your editor so that it correctly can
> identify .html.erb as "HTML (Rails)" in Textmate?
>
> It seems as the bundle is not yet updated.
> http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20on%
> 20Rails.tmbundle/Syntaxes/HTML%20(Rails).plist
>
> What do you do to syntax highlight correctly?
>

In textmate, open the bundle editor> Edit Languages
pick Rails: HTML(rails) from the left hand thing
Then change fileTypes = ( 'rhtml' );
to
fileTypes = ( 'rhtml', 'html.erb' );

Fred

Jesper Rønn-Jensen

unread,
Oct 10, 2007, 3:39:55 PM10/10/07
to Ruby on Rails: Talk
Frederick Cheung wrote:
> In textmate, open the bundle editor> Edit Languages
> pick Rails: HTML(rails) from the left hand thing
> Then change fileTypes = ( 'rhtml' );
> to
> fileTypes = ( 'rhtml', 'html.erb' );

Thanks Fred.
E-texteditor lacks the user interface that allows me to edit filetypes
in the bundle editor. Could you please post details from the file
"HTML (Rails).plist"

I want to see if it's a little E-texteditor bug or if I just get it
wrong.

(my workaround currently is to interpret all .erb files as
HTML(Rails), which is not particular smart for other formats than HTML)

Scott

unread,
Oct 17, 2007, 9:36:19 AM10/17/07
to Ruby on Rails: Talk
Did you ever find a real solution for this? E won't recognize html.erb
if you edit the plist file.

Frederick Cheung

unread,
Oct 17, 2007, 10:42:22 AM10/17/07
to rubyonra...@googlegroups.com

Oops, skipped over your mail until now. the relevant plist reads

{ scopeName = 'text.html.ruby';


fileTypes = ( 'rhtml', 'html.erb' );

...
}

Fred

Jesper Rønn-Jensen

unread,
Oct 19, 2007, 2:58:52 PM10/19/07
to Ruby on Rails: Talk
Scott:
I did solve it (with the workaround to view all .erb files as HTML/
Rails)

In
\Application Data\e\Bundles\Rails.tmbundle\Syntaxes\HTML
(Rails).plist:
<key>fileTypes</key>
<array>
<string>rhtml</string>
<string>erb</string> <!-- this is the line I added -->
</array>

Reply all
Reply to author
Forward
0 new messages