Thursday, January 31, 2008

JEdit Syntax Highlighting For Rails 2.0

A good and easy tip from Wes Shaddix to update JEdit syntax highlighting for rails 2.0 html.erb file:

  • Utilities => Global Options
  • Select “Editing”
  • In the “Change Settings For Mode” dropdown select RHTML
  • Unselect the “Use default settings” checkbox
  • Update the File name glob: setting to “*.{rhtml,html.erb}”
  • Apply and reload your html.erb file, syntax highlighting is back!

Thanks Wes Shaddix!

3 comments:

karatedog said...

Somehow it doesn't work on 'index.html.erb' and 'new.html.erb'. If I create a new file, and name it 'smthg.html.erb' it works fine. It even works on jEdit backup files like 'index.html.erb~'
If I renamed the above mentioned 'smthg.html.erb' to 'index.html.erb' syntax highlight is gone.

karatedog said...

wow, I just found a solution, although not a permanent one. When loading files where the extension should match RHTML (or any other edit mode), but somehow it fails to recognize the proper mode, you can doubleclick the edit mode on the status bar, and explicitly select it in a window and this selection will be remembered when you next reload the file.

Anonymous said...

small error in
"Update the File name glob: setting to “*.{rhtml,html.erb}”"

it must be a comma not a point before "erb" -> “*.{rhtml,html,erb}”