summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Emacs.org33
1 files changed, 27 insertions, 6 deletions
diff --git a/Emacs.org b/Emacs.org
index 4323e29..13f1dd5 100644
--- a/Emacs.org
+++ b/Emacs.org
@@ -662,25 +662,46 @@
662 662
663#+end_src 663#+end_src
664 664
665*** Type Script 665*** TypeScript
666 666
667#+begin_src emacs-lisp 667#+begin_src emacs-lisp
668 668
669 (use-package typescript-mode 669 (use-package typescript-mode
670 :mode ("\\.ts\\'")
670 :config 671 :config
671 (setq typescript-indent-level 2) 672 (setq typescript-indent-level 2))
672 (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode))) 673
674 (defun jd/activate-tide-mode ()
675 (when (and (stringp buffer-file-name)
676 (string-match "\\.[tj]sx?\\'" buffer-file-name))
677 (tide-setup)
678 (tide-hl-identifier-mode)))
673 679
674 (use-package tide 680 (use-package tide
675 :ensure t 681 :ensure t
676 :after (typescript-mode company) 682 :after (typescript-mode company web-mode))
677 :hook ((typescript-mode . tide-setup)
678 (typescript-mode . tide-hl-identifier-mode)))
679 683
680 (use-package flycheck 684 (use-package flycheck
681 :ensure t 685 :ensure t
682 :hook ((after-init . global-flycheck-mode))) 686 :hook ((after-init . global-flycheck-mode)))
683 687
688 (use-package web-mode
689 :ensure t
690 :hook ((web-mode . jd/activate-tide-mode))
691 :mode
692 ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'")
693 :config
694 (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'")))
695 (setq web-mode-markup-indent-offset 2)
696 (setq web-mode-css-indent-offset 2)
697 (setq web-mode-code-indent-offset 2)
698 (setq web-mode-script-padding 2)
699 (setq web-mode-block-padding 2)
700 (setq web-mode-style-padding 2)
701 (setq web-mode-enable-auto-pairing t)
702 (setq web-mode-enable-auto-closing t)
703 (setq web-mode-enable-current-element-highlight t))
704
684#+end_src 705#+end_src
685 706
686*** Yaml 707*** Yaml