Tidy `treesit' setup
This commit is contained in:
parent
d828941025
commit
ddcce0abff
1
.gitignore
vendored
1
.gitignore
vendored
@ -30,4 +30,5 @@ worg-backend-dependent-execution-update.org
|
||||
/eln-cache
|
||||
/elpa
|
||||
/quelpa
|
||||
/tree-sitter
|
||||
/var
|
||||
|
32
README.org
32
README.org
@ -369,15 +369,29 @@ the contents of packages and allows to update packages to the latest version.
|
||||
#+name: lst:setup-emacs-tree-sitter
|
||||
#+begin_src emacs-lisp
|
||||
(when (require 'treesit nil 'noerror)
|
||||
;; https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01372.html
|
||||
(let ((tselp (expand-file-name "~/VCS/tree-sitter-module/dist/")))
|
||||
(when (file-exists-p tselp)
|
||||
(add-to-list 'treesit-extra-load-path tselp)
|
||||
;; Does not play nicely with eglot:
|
||||
;; (setq major-mode-remap-alist '((python-mode . python-ts-mode)))
|
||||
;; Plays nicely with eglot:
|
||||
(add-to-list 'auto-mode-alist
|
||||
`(,(rx ".py" (opt (any "iw")) eos) . python-ts-mode)))))
|
||||
(setopt
|
||||
treesit-language-source-alist
|
||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash" "master" "src")
|
||||
(c "https://github.com/tree-sitter/tree-sitter-c" "master" "src")
|
||||
(cpp "https://github.com/tree-sitter/tree-sitter-cpp" "master" "src")
|
||||
(css "https://github.com/tree-sitter/tree-sitter-css" "master" "src")
|
||||
(go "https://github.com/tree-sitter/tree-sitter-go" "master" "src")
|
||||
(java "https://github.com/tree-sitter/tree-sitter-java" "master" "src")
|
||||
(javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src")
|
||||
(json "https://github.com/tree-sitter/tree-sitter-json" "master" "src")
|
||||
(julia "https://github.com/tree-sitter/tree-sitter-julia" "master" "src")
|
||||
(python "https://github.com/tree-sitter/tree-sitter-python" "master" "src")
|
||||
(ruby "https://github.com/tree-sitter/tree-sitter-ruby" "master" "src")
|
||||
(rust "https://github.com/tree-sitter/tree-sitter-rust" "master" "src")
|
||||
(scala "https://github.com/tree-sitter/tree-sitter-scala" "master" "src")
|
||||
(toml "https://github.com/tree-sitter/tree-sitter-toml" "master" "src")
|
||||
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master"
|
||||
"tsx/src")
|
||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master"
|
||||
"typescript/src")))
|
||||
|
||||
(add-to-list 'auto-mode-alist
|
||||
`(,(rx ".py" (opt (any "iw")) eos) . python-ts-mode)))
|
||||
#+end_src
|
||||
|
||||
* [[info:emacs#Faces][Text faces or styles (info)]]
|
||||
|
Loading…
Reference in New Issue
Block a user