erb syntax highlighting with TextMate

Posted by admin Tue, 26 Feb 2008 02:47:00 GMT

I finally am past fixing deprecation errors on older rails sites
and have started generating some new apps with rails 2.0.2
I realized that TextMate had not quite caught on, yet, to the new .erb
file extension and had to edit the property list to add syntax highlighting for
the newly created .erb files.
this is fairly simple
Just go to your Text Mate . app folder and ctrl-click to show package contents
go inside of Contents and then SharedSupport -> Bundles
then, ctrl-click to show package contents for Ruby on Rails.tmbundle
Inside of the folder Syntaxes is a file called HTML (Rails).plist
open it with your text editor or with the property list editor
right below filetypes->array->string->rhtml
just add this line
     <string>erb</string>


///the first few lines of the file should look like this
<dict>
	<key>fileTypes</key>
	<array>
		<string>rhtml</string>
		<string>erb</string>
	</array>

or if you are a commandlinejunkie like me
just type

open /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby\ on\ Rails.tmbundle/Syntaxes/HTML\ \(Rails\).plist

and then add a new sibling under the rhtml string for erb as well..
Then restart textmate and your erb files should look just like the rhtml files

Posted in  | Tags , , , , ,  | 2 comments | no trackbacks

Older posts: 1 2 3 ... 7