diff --git a/dotfiles/desktop/.emacs.d/lisp/tools/treesitter.el b/dotfiles/desktop/.emacs.d/lisp/tools/treesitter.el index 837b2ee..d8b019b 100644 --- a/dotfiles/desktop/.emacs.d/lisp/tools/treesitter.el +++ b/dotfiles/desktop/.emacs.d/lisp/tools/treesitter.el @@ -3,26 +3,17 @@ (use-package treesit :ensure nil :config - (setq treesit-font-lock-level 4) - (setq treesit-auto-install t) - (setq major-mode-remap-alist - '((c-mode . c-ts-mode) - (c++-mode . c++-ts-mode) - (go-mode . go-ts-mode) - (go-mod-mode . go-mod-ts-mode) - (python-mode . python-ts-mode) - (sh-mode . bash-ts-mode))) - (setq treesit-language-source-alist - '((bash "https://github.com/tree-sitter/tree-sitter-bash") - (c "https://github.com/tree-sitter/tree-sitter-c") - (cpp "https://github.com/tree-sitter/tree-sitter-cpp") - (dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile") - (go "https://github.com/tree-sitter/tree-sitter-go") - (gomod "https://github.com/camdencheek/tree-sitter-go-mod") - (js "https://github.com/tree-sitter/tree-sitter-javascript") - (json "https://github.com/tree-sitter/tree-sitter-json") - (node "https://github.com/tree-sitter/node-tree-sitter") - (python "https://github.com/tree-sitter/tree-sitter-python")))) + (setq treesit-font-lock-level 4)) + +(use-package treesit-auto + :ensure t + :after treesit + :custom + (treesit-auto-install 'prompt) + (treesit-auto-langs '(bash c cpp dockerfile go gomod json markdown python yaml)) + :config + (treesit-auto-add-to-auto-mode-alist 'all) + (global-treesit-auto-mode)) (provide 'treesitter)