all repos — nixfiles @ a4d0a3c574f960ef1304c6f01f56cbb0e96aa014

System and user configuration, managed by nix and home-manager

Emacs: open tsx files via typescript-mode by default
Alan Pearce alan@alanpearce.eu
Thu, 28 Jan 2021 15:55:23 +0100
commit

a4d0a3c574f960ef1304c6f01f56cbb0e96aa014

parent

c5500d5c4506db90268c1d1a1bbbfab8e1109e1e

1 files changed, 7 insertions(+), 4 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -707,7 +707,11 @@ (setq js-indent-level 2       js-enabled-frameworks '(javascript))
 
 ;;;; typescript
-(setq typescript-indent-level 2)
+(use-package typescript-mode
+  :mode (("\\.tsx\\'" . typescript-mode))
+  :config (progn
+            (setq typescript-indent-level 2)))
+
 (autoload 'ansi-color-apply-on-region "ansi-color")
 (defun colorise-compilation-buffer ()
   (ansi-color-apply-on-region compilation-filter-start (point-max)))
@@ -803,7 +807,7 @@ :gfhook (#'variable-pitch-mode)   :config (setq org-journal-date-format "%A, %d %B %Y"
                 org-journal-dir "~/Documents/journal"))
 
-;;;; web modes (tsx, html)
+;;;; web modes (html)
 
 (use-package css-mode
   :defer t
@@ -811,8 +815,7 @@ :config (progn             (setq css-indent-offset 2)))
 
 (use-package web-mode
-  :mode (("\\.tsx\\'" . web-mode)
-         ("\\.html?\\'" . web-mode))
+  :mode (("\\.html?\\'" . web-mode))
   :config (setq web-mode-enable-auto-pairing nil
                 web-mode-code-indent-offset 2
                 web-mode-markup-indent-offset 2