From 2c2d53b0a58dd9e01d80a6bef2aff0e982bf5953 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Fri, 29 Dec 2023 12:57:55 -0700 Subject: [PATCH] emacs ts astro mode --- .emacs.d/settings.org | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/.emacs.d/settings.org b/.emacs.d/settings.org index 45c97f1..046f12b 100644 --- a/.emacs.d/settings.org +++ b/.emacs.d/settings.org @@ -275,6 +275,15 @@ must run ~(all-the-icons-install-fonts)~ and ~(nerd-fonts-install-fonts)~ ("pyls.plugins.pyls_isort.enabled" t t)))) :commands lsp) #+END_SRC +** Tree-Sitter +#+BEGIN_SRC emacs-lisp + (use-package treesit-auto + :ensure t + :custom (treesit-auto-install 'prompt) + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) +#+END_SRC ** Languages *** Common Lisp **** Rainbow Parentheses @@ -332,11 +341,16 @@ After installing the ~rust-analyzer~, the following can be used: *** Web Stuff **** typescript-mode #+BEGIN_SRC emacs-lisp - ;; TODO: Update to tree-sitter in Emacs 29 (use-package typescript-mode :ensure t) (setq typescript-indent-level 2) #+END_SRC +**** astro +#+BEGIN_SRC emacs-lisp + (use-package astro-ts-mode + :ensure t) + ;; note - do treesit-install-language-grammar astro @ https://github.com/virchau13/tree-sitter-astro +#+END_SR **** TIDE #+BEGIN_SRC emacs-lisp (defun setup-tide-mode () @@ -357,7 +371,6 @@ After installing the ~rust-analyzer~, the following can be used: **** Web Mode #+BEGIN_SRC emacs-lisp - ;; web-mode (setq web-mode-markup-indent-offset 2) (setq web-mode-code-indent-offset 2) (setq web-mode-css-indent-offset 2) @@ -370,14 +383,6 @@ After installing the ~rust-analyzer~, the following can be used: ("\\.html\\'" . web-mode)) :commands web-mode) #+END_SRC -**** Prettier -#+BEGIN_SRC emacs-lisp - (use-package prettier-js - :ensure t) - (add-hook 'js2-mode-hook 'prettier-js-mode) - (add-hook 'typescript-mode 'prettier-js-mode) - (add-hook 'web-mode-hook 'prettier-js-mode) -#+END_SRC **** Prisma #+BEGIN_SRC emacs-lisp (use-package prisma-mode @@ -396,6 +401,15 @@ After installing the ~rust-analyzer~, the following can be used: :host github :repo "leafOfTree/svelte-mode")) #+END_SRC +**** Prettier +#+BEGIN_SRC emacs-lisp + (use-package prettier-js + :ensure t) + (add-hook 'astro-ts-mode-hook 'prettier-js-mode) + (add-hook 'js2-mode-hook 'prettier-js-mode) + (add-hook 'typescript-mode 'prettier-js-mode) + (add-hook 'web-mode-hook 'prettier-js-mode) +#+END_SRC *** Kotlin #+BEGIN_SRC emacs-lisp (use-package kotlin-mode @@ -419,6 +433,7 @@ After installing the ~rust-analyzer~, the following can be used: (use-package format-all :ensure t) (add-hook 'prog-mode-hook 'format-all-mode) + (add-hook 'astro-ts-mode-hook 'format-all-mode) (add-hook 'format-all-mode-hook 'format-all-ensure-formatter) #+END_SRC