.rhtml syntax and win32 editor

J

JZ

Do you know any editor/ide for win32 which can recognize .rhtml syntax? I
like Eclipse but its Ruby plugin understand only .rb files. Quite good
effect has SciTe with PHP settings choosen for rhtml but it is not perfect.
 
B

Belorion

Do you know any editor/ide for win32 which can recognize .rhtml syntax? I
like Eclipse but its Ruby plugin understand only .rb files. Quite good
effect has SciTe with PHP settings choosen for rhtml but it is not perfec=
t.

jEdit does not too shabby. Especially when you throw in the Ruby
plugin (doesn't change syntax highlighting, but still useful!)

http://www.jedit.org/
http://www.jedit.org/ruby/

Matt
 
V

Vincent Foley

If one of them is your cup of tea, vim and Emacs both do rhtml
highlighting. For vim, just get eruby.vim and have an autocommand to
load that file when you open a .rhtml file.

Emacs is trickier, you gotta use mmm-mode, a mode that allows multiple
major mode to be on simultaneously. Here's my config:

(require 'mmm-mode)
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)
(set-face-background 'mmm-output-submode-face "DarkSlateGray")
(set-face-background 'mmm-code-submode-face "DarkSlateBlue")
(set-face-background 'mmm-comment-submode-face "DarkOliveGreen")
(mmm-add-classes
'((erb-code
:submode ruby-mode
:match-face (("<%#" . mmm-comment-submode-face)
("<%=" . mmm-output-submode-face)
("<%" . mmm-code-submode-face))
:front "<%[#=]?"
:back "%>"
:insert ((?% erb-code nil @ "<%" @ " " _ " " @ "%>" @)
(?# erb-comment nil @ "<%#" @ " " _ " " @ "%>" @)
(?= erb-expression nil @ "<%=" @ " " _ " " @ "%>" @)))))
(add-hook 'html-mode-hook
(lambda ()
(local-set-key (kbd "<f8>") 'mmm-parse-buffer)
(setq mmm-classes '(erb-code))
(mmm-mode-on)))
(add-to-list 'auto-mode-alist '("\\.rhtml$" . html-mode))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,921
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top