i_trope
i_trope

Reputation: 1604

Enabling ruby syntax highlighting for Emacs html.erb files

I am running Emacs Live with Rinari. In .erb files html-mode is enabled automatically, however embedded Ruby is not highlighted according to ruby-mode. Is there any way to enable both html-mode and ruby-mode within .html.erb files?

Upvotes: 7

Views: 3295

Answers (2)

Devaroop
Devaroop

Reputation: 8023

Install 'rinari' for emacs which is specially for ROR. It has a mode called eruby-nxhtml-mumamo-mode which hightlights the html.erb syntax as we need. This link will help you how to install it. It takes care of everything. Enjoy!

Upvotes: 0

Chris
Chris

Reputation: 137215

Check out web-mode, which is designed for HTML templating. It can be installed via MELPA or Marmalade. (Note that this is not a way to run html-mode and ruby-mode simultaneously as you requested; it's a completely different mode. It's also probably your best bet.)

Out of the box, it supports .html.erb (and many others), with superficial CSS and JavaScript support (highlighting and indenting).

Upvotes: 11

Related Questions