Skip to content

Instantly share code, notes, and snippets.

@dgellow
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dgellow/6353f5e5693c7e1461a1 to your computer and use it in GitHub Desktop.
Save dgellow/6353f5e5693c7e1461a1 to your computer and use it in GitHub Desktop.
Configure mmm-mode for React, using js2-mode for javascript and web-mode for JSX.
(require 'mmm-mode)
(mmm-add-classes
'((jsx
:submode web-mode
:front "\\((\\)[[:space:]\n]*<"
:front-match 1
:back ">[[:space:]\n]*\\()\\)"
:back-match 1)))
(setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class 'js2-mode "\\.jsx\\'" 'jsx)
@dwinston
Copy link

Thank you!

@L42y
Copy link

L42y commented Mar 17, 2015

indentation is incorrect as in the following image:

any idea why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment