Created
April 1, 2015 12:40
-
-
Save gongo/a27096d6952802943d1e to your computer and use it in GitHub Desktop.
Syntax highlighting/support for vueify file (.vue) using mmm-mode
This file contains hidden or 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
(require 'mmm-mode) | |
(setq mmm-global-mode 'maybe) | |
(dolist (langsets '(("script" . ((coffee . coffee-mode) | |
(es6 . js2-mode))) | |
("style" . ((stylus . stylus-mode) | |
(less . less-css-mode) | |
(scss . scss-mode))))) | |
(let ((tag (car langsets))) | |
(dolist (pair (cdr langsets)) | |
(let* ((lang (car pair)) | |
(submode (cdr pair)) | |
(class-name (make-symbol (format "vueify-%s-%s" tag lang))) | |
(front (format "<%s lang=\"%s\">" tag lang)) | |
(back (format "</%s>" tag))) | |
(mmm-add-classes | |
`((,class-name | |
:submode ,submode | |
:front ,front | |
:back ,back))) | |
(mmm-add-mode-ext-class nil "\\.vue?\\'" class-name))))) | |
(add-to-list 'auto-mode-alist '("\\.vue?\\'" . web-mode)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment