Agile Tortoise
Greg Pierce’s blog
« Large client app online Welcome to the blogosphere, sis! »
TextMate syntax coloring and Rails 2.0
Now that the Ruby on Rails 2.0 Preview Release is out, I'm playing around with it. First thing I noticed, while minor, is that TextMate's syntax coloring for "HTML (Rails)" doesn't recognize the new view naming scheme. "rhtml" is now replaced by "html.erb" as the file extension.
It's a simple fix, however. Just open up the Bundle Editor, go to the "Rails" bundle, then the "HTML (Rails)" language definition, and add 'erb' to the filetypes array on the second line. Like:
JavaScript:
-
{ scopeName = 'text.html.ruby';
-
fileTypes = ( 'rhtml', 'erb' );
-
...
January 14th, 2008 at 12:34 pm
awesome! thanks for helping me fix this niggle.
January 29th, 2008 at 12:39 pm
Weird, It only works on the layouts folder, but when I’ve added it on the HTML bundle, it works
just add ‘html.erb’ on the fileTypes:
e.g.
fileTypes = ( ‘html’, ‘htm’, ’shtml’, ‘xhtml’, ‘phtml’, ‘php’, ‘inc’, ‘tmpl’, ‘tpl’, ‘html.erb’);
March 23rd, 2008 at 1:19 pm
Thanks for the tip. I’ve been slacking on fixing this annoyance and finally saw how simple it was and it worked great!
May 13th, 2008 at 10:27 pm
[...] What to do? A few people have suggested tweaks using TextMate’s Bundle Editor (here and here). A better option is the new TextMate Rails 2.0 bundle now under development by Dr Nic Williams. [...]
August 4th, 2008 at 5:22 am
Coloration syntaxique des fichiers .html.erb dans TextMate…
TextMate Version 1.5.7 (1436) ne reconnaît pas l’extension .html.erb dans le bundle Ruby on Rails. Pour l’ajouter, ouvrir le Bundle Editor, filtrer par Langage, et sélectionner HTML (Rails) sous Ruby on Rails. Ajouter l’extension :
…
August 13th, 2008 at 7:50 pm
that’s cool, but …
now i have a new erb.icns file.
how do i tell TextMate to use it with .erb files??