From cde2348efff2e96474741d0ba2940d98fe0618e6 Mon Sep 17 00:00:00 2001 From: Sako <78461130+Sakooooo@users.noreply.github.com> Date: Sat, 9 Dec 2023 18:16:04 +0400 Subject: [PATCH] Update emacs.org --- config/emacs/emacs.org | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index 62d3b7f1..0ef41373 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -870,16 +870,37 @@ make sure to setup authinfo #+end_src ***** Javascript #+begin_src emacs-lisp - (use-package js2-mode - :straight t - :mode "\\.js\\'" - :hook (js2-mode . lsp) - :config - (setq web-mode-markup-indent-offset 2) ; HTML - (setq web-mode-css-indent-offset 2) ; CSS - (setq web-mode-code-indent-offset 2) ; JS/JSX/TS/TSX - (setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'")))) + (use-package js2-mode + :straight t + :mode ("\\.js\\'" + "\\.jsx\\'") + :hook (js2-mode . lsp) + :config + (setq web-mode-markup-indent-offset 2) ; HTML + (setq web-mode-css-indent-offset 2) ; CSS + (setq web-mode-code-indent-offset 2) ; JS/JSX/TS/TSX + (setq web-mode-content-types-alist '(("jsx" . "\\.js[x]?\\'")))) #+end_src +***** Typescript +#+begin_src emacs-lisp + (use-package typescript-mode + :straight t + :mode ("\\.ts\\'" + "\\.tsx\\'") + :hook (typescript-mode . lsp)) +#+end_src +***** Astro + #+begin_src emacs-lisp +(use-package astro-ts-mode +:straight t +:mode "\\.astro\\'" +:hook (astro-ts-mode . lsp) +:config +(setq treesit-language-source-alist + '((astro "https://github.com/virchau13/tree-sitter-astro") + (css "https://github.com/tree-sitter/tree-sitter-css") + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))) + #+end_src> ***** C/C++ #+begin_src emacs-lisp (add-hook 'c-mode-hook 'lsp)