From 59aed257763185b02e89713114fdecf216a16899 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Wed, 26 Jun 2024 23:57:05 +0200 Subject: [PATCH] Update .emacs.d/config.org --- private_dot_emacs.d/config.org | 41 ++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/private_dot_emacs.d/config.org b/private_dot_emacs.d/config.org index a37e29e..b4ff71d 100644 --- a/private_dot_emacs.d/config.org +++ b/private_dot_emacs.d/config.org @@ -230,7 +230,6 @@ I use org-superstar-mode, as it makes headlines and bullets look really nice. (setq lsp-keymap-prefix "C-c l") (setq read-process-output-max (* 1024 1024)) (setq gc-cons-threshold 100000000)) - (use-package lsp-ui) #+end_src @@ -268,21 +267,49 @@ Magit is a git client in Emacs. *** Languages **** Rust - #+begin_src emacs-lisp (use-package rust-mode :init (setq rust-format-on-save t)) #+end_src -**** Typescript +**** tree-sitter #+begin_src emacs-lisp - (use-package typescript-mode - :hook (typescript-mode . lsp) - :config - (setq typescript-indent-level 2)) + (setq treesit-language-source-alist + '((bash "https://github.com/tree-sitter/tree-sitter-bash") + (cmake "https://github.com/uyha/tree-sitter-cmake") + (css "https://github.com/tree-sitter/tree-sitter-css") + (elisp "https://github.com/Wilfred/tree-sitter-elisp") + (go "https://github.com/tree-sitter/tree-sitter-go") + (html "https://github.com/tree-sitter/tree-sitter-html") + (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") + (json "https://github.com/tree-sitter/tree-sitter-json") + (make "https://github.com/alemuller/tree-sitter-make") + (markdown "https://github.com/ikatyang/tree-sitter-markdown") + (python "https://github.com/tree-sitter/tree-sitter-python") + (toml "https://github.com/tree-sitter/tree-sitter-toml") + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") + (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") + (yaml "https://github.com/ikatyang/tree-sitter-yaml"))) + + (add-to-list 'auto-mode-alist '("\\.ts\\'" . tsx-ts-mode)) + (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)) + #+end_src #+begin_src sh npm install -g typescript-language-server #+end_src + +**** Alapheia +#+begin_src emacs-lisp + (use-package apheleia + :ensure t + :config + (apheleia-global-mode +1) + (setf (alist-get 'prettier apheleia-formatters) + '(npx "prettier" file)) + (setf (alist-get 'prettier-typescript apheleia-formatters) + '(npx "prettier" file))) + (use-package dtrt-indent) +#+end_src