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

**URL:** <https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864>\
**Category:** Rails\
**Created:** [October 10, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864 "2007-10-10T15:36:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 10, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/1 "2007-10-10T15:36:43Z")

</div>

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](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

> **[人気の自動車保険を口コミ・相場からランキングでご紹介!](https://www.e-texteditor.com)**
>
> 人気のある自動車保険を口コミやランキングで検証!

---

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 10, 2007, 3:54pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/2 "2007-10-10T15:54:57Z")

</div>

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

> 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

---

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 10, 2007, 9:40pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/3 "2007-10-10T21:40:28Z")

</div>

Frederick C. 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)

---

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 17, 2007, 3:36pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/4 "2007-10-17T15:36:47Z")

</div>

Did you ever find a real solution for this? E won’t recognize html.erb  
if you edit the plist file.

---

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 19, 2007, 8:59pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/5 "2007-10-19T20:59:34Z")

</div>

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:  
fileTypes  
  
rhtml  
erb

---

<div class="post-metadata">

**Author:** ![Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@Jesper\_RSSSSnn-Jens](https://www.ruby-forum.com/u/Jesper_RSSSSnn-Jens)\
**Post date:** [October 17, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/how-to-syntax-highlight-rails-2-0-html-erb-files-in-textmate-e-texteditor/116864/6 "2007-10-17T16:44:07Z")

</div>

On 10 Oct 2007, at 20:39, Jesper Rønn-Jensen wrote:

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

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

{ scopeName = ‘text.html.ruby’;  
fileTypes = ( ‘rhtml’, ‘html.erb’ );  
…  
}

Fred
