Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling ruby syntax highlighting for Emacs html.erb files

Tags:

emacs

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?

like image 500
i_trope Avatar asked Jan 10 '14 15:01

i_trope


1 Answers

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

like image 172
Chris Avatar answered Oct 16 '22 04:10

Chris