all repos — nixfiles @ 557058a3575995c0d0d7b7072d0f769d7621c049

System and user configuration, managed by nix and home-manager

Emacs: install tree-sitter-mode
Alan Pearce alan@alanpearce.eu
Mon, 20 Jun 2022 15:49:35 +0200
commit

557058a3575995c0d0d7b7072d0f769d7621c049

parent

b99574bd0f4c17cd2b6cfb09b8c519f0d03d4a47

2 files changed, 23 insertions(+), 0 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -910,6 +910,26 @@ :defer t   :config (progn
             (setq treemacs-no-png-images t)))
 
+(use-package tree-sitter
+  :ghook ('(sh-mode-hook
+            c-mode-common-hook
+            css-mode-hook
+            go-mode-hook
+            html-mode-hook
+            nix-mode-hook
+            js-mode-hook
+            js2-mode-hook
+            json-mode-hook
+            typescript-mode-hook
+            python-mode-hook
+            rustic-mode-hook))
+  :ghook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)
+(use-package tree-sitter-langs
+  :after tree-sitter)
+
+(use-package tree-sitter-indent
+  :ghook ('(rustic-mode-hook)))
+
 (use-package lsp-mode
   :defer 2
   :general (:states 'normal :keymaps 'lsp-mode-map
M user/settings/emacs.nixuser/settings/emacs.nix
@@ -169,6 +169,9 @@ spacemacs-theme       swiper
       tide
       toml-mode
+      tree-sitter
+      tree-sitter-langs
+      tree-sitter-indent
       typescript-mode
       undo-tree
       use-package