From db8b9b08a68fce9f4ff0f0d7feadf0c7c4c46cbf Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 25 Mar 2022 22:09:02 -0400 Subject: [PATCH 1/2] Added packages for JS/TS developement --- emacs.d/init.el | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/emacs.d/init.el b/emacs.d/init.el index 463df1a..c59f654 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -122,7 +122,6 @@ (load-theme 'everforest-hard-dark)) ;; (use-package base16-theme -;; :ensure t ;; :config ;; (load-theme 'gruvbox-dark-soft t)) @@ -234,10 +233,13 @@ ((c-mode . lsp) (c++-mode . lsp) (java-mode . lsp) + (js-mode . lsp) + (latex-mode . lsp) (python-mode . lsp) (rust-mode . lsp) (tex-mode . lsp) - (latex-mode . lsp) + (typescript-mode . lsp) + (web-mode . lsp) (zig-mode . lsp) (lsp-mode . lsp-enable-which-key-integration)) :config @@ -302,6 +304,7 @@ ;;; Languages ;; C/C++ + (setq-default c-default-style "k&r") (setq-default c-basic-offset 2) @@ -317,6 +320,20 @@ ;(use-package lsp-java) +;; JavaScript/TypeScript + +(setq js-indent-level 2) + +(use-package typescript-mode + :config + (setq typescript-indent-level 2)) + +(use-package js2-mode + :config + (add-to-list 'magic-mode-alist '("#!/usr/bin/env node" . js2-mode)) + (setq js2-mode-show-strict-warnings nil) + :hook (js-mode . js2-minor-mode)) + ;; LaTeX (use-package lsp-latex) From ab413f92521dc4bb5eceeed1788e93289e6d6b49 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 25 Mar 2022 23:37:52 -0400 Subject: [PATCH 2/2] Minor changes to js2-mode --- emacs.d/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs.d/init.el b/emacs.d/init.el index c59f654..78fdb39 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -330,9 +330,9 @@ (use-package js2-mode :config - (add-to-list 'magic-mode-alist '("#!/usr/bin/env node" . js2-mode)) + (add-to-list 'interpreter-mode-alist '("#!/usr/bin/env node" . js2-mode)) (setq js2-mode-show-strict-warnings nil) - :hook (js-mode . js2-minor-mode)) + :hook ('js-mode-hook 'js2-minor-mode)) ;; LaTeX