From 83bd4881fcb4a701f8fa5ff8d15d2e5dcb356a3d Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Sat, 17 Oct 2020 18:12:33 -0400 Subject: [PATCH] Add TypeScript mode --- init.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index 23a5cb3..a443b04 100644 --- a/init.el +++ b/init.el @@ -445,8 +445,7 @@ ;; Load Web Mode ;; (Associated files: .php, .html) -;; (In js-mode: .ts) -;; (In js-jsx-mode: .jsx, .tsx) +;; (In js-jsx-mode: .jsx) (use-package web-mode :custom (web-mode-markup-indent-offset 2) @@ -454,8 +453,13 @@ :mode (("\\.php\\'" . web-mode) ("\\.html\\'" . web-mode) - ("\\.ts\\'" . js-mode) - ("\\.[jt]sx\\'" . js-jsx-mode))) + ("\\.jsx\\'" . js-jsx-mode))) + +;; Load TypeScript mode +;; (Associated files: .ts, .tsx) +(use-package typescript-mode + :mode + (("\\.tsx?\\'" . typescript-mode))) ;; Load JSON Mode ;; (Associated files: .json) @@ -505,11 +509,12 @@ ;;==================== ;; Load LSP Mode -;; Associated languages: HTML, JavaScript, JSON, GDScript, Rust +;; Associated languages: HTML, JavaScript, TypeScript, CSS, JSON, GDScript, Rust (use-package lsp-mode :hook (web-mode . lsp-deferred) (js-mode . lsp-deferred) + (typescript-mode . lsp-deferred) (css-mode . lsp-deferred) (json-mode . lsp-deferred) (gdscript-mode . lsp-deferred)