Add tree-sitter config for various languages.
This commit is contained in:
parent
765680a051
commit
8e9a3fc301
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,3 +24,4 @@ workspace/
|
|||||||
/projectile.cache
|
/projectile.cache
|
||||||
/request/
|
/request/
|
||||||
/smex-items
|
/smex-items
|
||||||
|
/tree-sitter/
|
||||||
|
@ -282,6 +282,42 @@
|
|||||||
:defer t
|
:defer t
|
||||||
:straight (silicon :type git :host github :repo "iensu/silicon-el"))
|
:straight (silicon :type git :host github :repo "iensu/silicon-el"))
|
||||||
|
|
||||||
|
;; Tree-sitter :)
|
||||||
|
(use-package treesit
|
||||||
|
:defer t
|
||||||
|
:straight (:type built-in)
|
||||||
|
:commands (treesit-install-language-grammar nf/treesit-install-all-languages)
|
||||||
|
:config
|
||||||
|
(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"))
|
||||||
|
(css . ("https://github.com/tree-sitter/tree-sitter-css"))
|
||||||
|
(go . ("https://github.com/tree-sitter/tree-sitter-go"))
|
||||||
|
(haskell . ("https://github.com/tree-sitter/tree-sitter-haskell"))
|
||||||
|
(html . ("https://github.com/tree-sitter/tree-sitter-html"))
|
||||||
|
(java . ("https://github.com/tree-sitter/tree-sitter-java"))
|
||||||
|
(javascript . ("https://github.com/tree-sitter/tree-sitter-javascript"))
|
||||||
|
(json . ("https://github.com/tree-sitter/tree-sitter-json"))
|
||||||
|
(julia . ("https://github.com/tree-sitter/tree-sitter-julia"))
|
||||||
|
(lua . ("https://github.com/Azganoth/tree-sitter-lua"))
|
||||||
|
(make . ("https://github.com/alemuller/tree-sitter-make"))
|
||||||
|
(python . ("https://github.com/tree-sitter/tree-sitter-python"))
|
||||||
|
(php . ("https://github.com/tree-sitter/tree-sitter-php"))
|
||||||
|
(ruby . ("https://github.com/tree-sitter/tree-sitter-ruby"))
|
||||||
|
(rust . ("https://github.com/tree-sitter/tree-sitter-rust"))
|
||||||
|
(sql . ("https://github.com/m-novikov/tree-sitter-sql"))
|
||||||
|
(toml . ("https://github.com/tree-sitter/tree-sitter-toml"))
|
||||||
|
(zig . ("https://github.com/GrayJack/tree-sitter-zig"))))
|
||||||
|
(defun nf/treesit-install-all-languages ()
|
||||||
|
"Install all languages specified by `treesit-language-source-alist'."
|
||||||
|
(interactive)
|
||||||
|
(let ((languages (mapcar 'car treesit-language-source-alist)))
|
||||||
|
(dolist (lang languages)
|
||||||
|
(treesit-install-language-grammar lang)
|
||||||
|
(message "`%s' parser was installed." lang)
|
||||||
|
(sit-for 0.75)))))
|
||||||
|
|
||||||
;; Cuando presionas enter en un bloque de comentario sigue el estilo del bloque.
|
;; Cuando presionas enter en un bloque de comentario sigue el estilo del bloque.
|
||||||
(use-package vs-comment-return
|
(use-package vs-comment-return
|
||||||
:straight (vs-comment-return :type git :host github :repo "emacs-vs/vs-comment-return")
|
:straight (vs-comment-return :type git :host github :repo "emacs-vs/vs-comment-return")
|
||||||
|
Loading…
Reference in New Issue
Block a user