mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 23:49:56 +00:00
Use treesit-auto for mode remapping
This commit is contained in:
@@ -3,26 +3,17 @@
|
|||||||
(use-package treesit
|
(use-package treesit
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:config
|
:config
|
||||||
(setq treesit-font-lock-level 4)
|
(setq treesit-font-lock-level 4))
|
||||||
(setq treesit-auto-install t)
|
|
||||||
(setq major-mode-remap-alist
|
(use-package treesit-auto
|
||||||
'((c-mode . c-ts-mode)
|
:ensure t
|
||||||
(c++-mode . c++-ts-mode)
|
:after treesit
|
||||||
(go-mode . go-ts-mode)
|
:custom
|
||||||
(go-mod-mode . go-mod-ts-mode)
|
(treesit-auto-install 'prompt)
|
||||||
(python-mode . python-ts-mode)
|
(treesit-auto-langs '(bash c cpp dockerfile go gomod json markdown python yaml))
|
||||||
(sh-mode . bash-ts-mode)))
|
:config
|
||||||
(setq treesit-language-source-alist
|
(treesit-auto-add-to-auto-mode-alist 'all)
|
||||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
(global-treesit-auto-mode))
|
||||||
(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"))))
|
|
||||||
|
|
||||||
(provide 'treesitter)
|
(provide 'treesitter)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user