summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-03 12:31:52 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-03 12:31:52 +0200
commit0e849f058cc959a8fa4cd521d6d62f708d77ce55 (patch)
tree299fc27e625540f6e7f14a23419066792557c3ed
parente44b8450f7f192acff023aa51b46b97d7404bb0a (diff)
emacs: Add ‘mango-treesit-install’
-rw-r--r--.config/emacs/config.org8
1 files changed, 8 insertions, 0 deletions
diff --git a/.config/emacs/config.org b/.config/emacs/config.org
index dc7e06e..ef99206 100644
--- a/.config/emacs/config.org
+++ b/.config/emacs/config.org
@@ -772,6 +772,14 @@ already installed unfortunately, but it’s easy enough to do manually.
(toml "https://github.com/tree-sitter/tree-sitter-toml")
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))
+ (defun mango-treesit-install ()
+ "Install all the tree-sitter grammars in ‘treesit-language-source-alist’.
+ This function does not assert whether or not the grammar is already installed,
+ making it useful for updating existing grammars."
+ (interactive)
+ (dolist (spec treesit-language-source-alist)
+ (treesit-install-language-grammar (car spec))))
+
;; Automatically install missing grammars
(thread-last
(mapcar #'car treesit-language-source-alist)