From 8e6f9fb0b27c1a76e3061ea1a6e58d3963112137 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Fri, 18 Aug 2023 12:27:47 +0100 Subject: [PATCH] Add treesitter grammars --- .emacs.d/init.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e2c551b..7019058 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -190,6 +190,32 @@ (define-key company-active-map (kbd "C-") 'my-tab) (define-key company-active-map (kbd "C-TAB") 'my-tab)) +(setq treesit-language-source-alist + '((bash "https://github.com/tree-sitter/tree-sitter-bash") + (cmake "https://github.com/uyha/tree-sitter-cmake") + (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") + (html "https://github.com/tree-sitter/tree-sitter-html") + (javascript "https://github.com/tree-sitter/tree-sitter-javascript" "master" "src") + (json "https://github.com/tree-sitter/tree-sitter-json") + (make "https://github.com/alemuller/tree-sitter-make") + (markdown "https://github.com/ikatyang/tree-sitter-markdown") + (python "https://github.com/tree-sitter/tree-sitter-python") + (toml "https://github.com/tree-sitter/tree-sitter-toml") + (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") + (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") + (yaml "https://github.com/ikatyang/tree-sitter-yaml"))) + +(setq major-mode-remap-alist + '((yaml-mode . yaml-ts-mode) + (bash-mode . bash-ts-mode) + (js2-mode . js-ts-mode) + (typescript-mode . typescript-ts-mode) + (json-mode . json-ts-mode) + (css-mode . css-ts-mode) + (python-mode . python-ts-mode))) + ;; Adapted from https://github.com/Slackwise/dotfiles/blob/master/emacs/slackwise.el (setq-default functions-file (concat (or (getenv "XDG_CONFIG_HOME") "~/.emacs.d/") "functions.el"))