Actually use treesit modes

This commit is contained in:
eriedaberrie 2023-01-06 09:47:59 -08:00
parent af2fc95ee3
commit 910628a012

25
init.el
View file

@ -188,6 +188,17 @@
(use-package treesit
:ensure nil
:init
(add-to-list 'major-mode-remap-alist '(sh-mode . bash-ts-mode))
(add-to-list 'major-mode-remap-alist '(css-mode . css-ts-mode))
(add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
(add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))
(add-to-list 'major-mode-remap-alist '(csharp-mode . csharp-ts-mode))
(add-to-list 'major-mode-remap-alist '(java-mode . java-ts-mode))
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
(add-to-list 'major-mode-remap-alist '(ruby-mode . ruby-ts-mode))
(add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
(add-to-list 'major-mode-remap-alist '(js-json-mode . json-ts-mode))
:custom
(treesit-extra-load-path `(,(expand-file-name "tree-sitter-module/dist/"
user-emacs-directory))))
@ -199,6 +210,7 @@
(use-package aggressive-indent
:hook (lispyville-mode
nix-mode
org-mode))
(use-package rainbow-delimiters
@ -275,7 +287,7 @@
(dirvish-override-dired-mode))
(use-package pdf-tools
:mode (("\\.pdf\\'" . pdf-view-mode))
:mode ("\\.pdf\\'" . pdf-view-mode)
:config
(pdf-tools-install))
@ -286,7 +298,7 @@
(buffer-face-mode))
(use-package org
:mode (("\\.org$" . org-mode))
:mode ("\\.org$" . org-mode)
:hook ((org-mode . org-indent-mode)
(org-mode . flyspell-mode)
(org-mode . auto-fill-mode)
@ -317,11 +329,11 @@
:config
(editorconfig-mode))
(use-package json-mode
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'")
(use-package nix-mode
:mode "\\.nix'")
:mode "\\.nix'"
:hook (nix-mode . (lambda ()
(with-eval-after-load 'evil
(setq-local evil-shift-width 2)))))
(use-package markdown-mode
:mode ("README\\.md\\'" . gfm-mode)
@ -495,6 +507,7 @@
(add-to-list 'after-make-frame-functions #'frame-make-detect-term)
(add-to-list 'auto-mode-alist '("\\.yuck\\'" . lisp-mode))
(add-to-list 'auto-mode-alist '("flake\\.lock\\'" . js-json-mode))
(with-current-buffer "*scratch*"
(cd "~/"))