Last active
December 21, 2015 01:19
-
-
Save whitlockjc/6226791 to your computer and use it in GitHub Desktop.
Use mmm-mode to enable EJS Template highlighting in html-mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ... | |
;; Use mmm-mode to enable EJS (http://embeddedjs.com) Template highlighting in html-mode | |
;; Turn on mmm-mode | |
(require 'mmm-mode) | |
(setq mmm-global-mode 'maybe) | |
;; mmm-mode class for EJS Templates | |
(mmm-add-classes | |
'( | |
(html-ejs :submode js-mode :front "<%[#=]?" :back "-?%>" | |
:match-face (("<%#" . mmm-comment-submode-face) | |
("<%=" . mmm-output-submode-face) | |
("<%" . mmm-code-submode-face)) | |
:insert ((?% ejs-code nil @ "<%" @ " " _ " " @ "%>" @) | |
(?# ejs-comment nil @ "<%#" @ " " _ " " @ "%>" @) | |
(?= ejs-expression nil @ "<%=" @ " " _ " " @ "%>" @)) | |
))) | |
;;; Add html-js, embedded-css and html-ejs to html-mode | |
(mmm-add-mode-ext-class 'html-mode nil 'html-js) | |
(mmm-add-mode-ext-class 'html-mode nil 'html-css) | |
(mmm-add-mode-ext-class 'html-mode nil 'html-ejs) | |
;; ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment