summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-02 18:59:08 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-02 18:59:26 +0200
commitf5fc0136272d28c8e046b285ffb7da1f362defac (patch)
treef064e69c8cd85e9cfea64b5b9a076166f151828d
parent8790589c2c3194e3df29446c94ae19b3f8d18d29 (diff)
emacs: Add Go tree-sitter support
-rw-r--r--.config/emacs/config.org8
1 files changed, 7 insertions, 1 deletions
diff --git a/.config/emacs/config.org b/.config/emacs/config.org
index a06f592..4c39ec3 100644
--- a/.config/emacs/config.org
+++ b/.config/emacs/config.org
@@ -763,6 +763,7 @@ already installed unfortunately, but it’s easy enough to do manually.
(css "https://github.com/tree-sitter/tree-sitter-css")
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
(go "https://github.com/tree-sitter/tree-sitter-go")
+ (go-mod "https://github.com/camdencheek/tree-sitter-go-mod.git")
(html "https://github.com/tree-sitter/tree-sitter-html")
(json "https://github.com/tree-sitter/tree-sitter-json")
(make "https://github.com/alemuller/tree-sitter-make")
@@ -771,6 +772,9 @@ 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")))
+ (setq treesit-load-name-override-list
+ '((go-mod "libtree-sitter-go-mod" "tree_sitter_gomod")))
+
;; Automatically install missing grammars
(thread-last
(mapcar #'car treesit-language-source-alist)
@@ -1160,10 +1164,12 @@ file with a certain file extension.
#+BEGIN_SRC elisp
+ (require 'go-ts-mode)
(require 'rust-ts-mode)
(require 'yaml-ts-mode)
- (dolist (pair '(("\\.py\\'" . python-ts-mode)
+ (dolist (pair '(("\\.go\\'" . go-ts-mode)
+ ("\\.py\\'" . python-ts-mode)
("\\.rs\\'" . rust-ts-mode)
("\\.ya?ml\\'" . yaml-ts-mode)))
(add-to-list 'auto-mode-alist pair))