all repos — archive/dotfiles @ 053df601845b618847d56f837b9e33c4b52fcdca

Superseded by nixfiles

Emacs: Use web-mode for jsx files
Alan Pearce alan@alanpearce.co.uk
Mon, 04 Jan 2016 14:35:31 +0100
commit

053df601845b618847d56f837b9e33c4b52fcdca

parent

4e27638ec46cee2fdf7c7d838a5375b66c00939d

1 files changed, 13 insertions(+), 12 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -2039,18 +2039,19 @@ is really nice, because it handles the HTML part the same way in all of them as well.
 
 #+BEGIN_SRC emacs-lisp
-(use-package web-mode
-  :mode (("/views/.*\\.php\\'" . web-mode)
-         ("/layouts/.*\\.html\\'" . web-mode)
-         ("/templates/.*\\.php\\'" . web-mode)
-         ("\\.ejs\\'" . web-mode))
-  :config (setq web-mode-code-indent-offset 4
-                web-mode-css-indent-offset 4
-                web-mode-markup-indent-offset 4
-                web-mode-style-padding 0
-                web-mode-script-padding 0
-                web-mode-comment-style 2
-                web-mode-enable-auto-pairing nil))
+  (use-package web-mode
+    :mode (("/views/.*\\.php\\'" . web-mode)
+           ("/layouts/.*\\.html\\'" . web-mode)
+           ("/templates/.*\\.php\\'" . web-mode)
+           ("\\.ejs\\'" . web-mode)
+           ("\\.jsx\\'" . web-mode))
+    :config (setq web-mode-code-indent-offset 4
+                  web-mode-css-indent-offset 4
+                  web-mode-markup-indent-offset 4
+                  web-mode-style-padding 0
+                  web-mode-script-padding 0
+                  web-mode-comment-style 2
+                  web-mode-enable-auto-pairing nil))
 #+END_SRC
 
 I derived a mode for twig, in order to use its =mode-hook=.