Move the definition of treesitter grammars to the init block.

This commit is contained in:
Tom Alexander 2023-05-27 12:09:15 -04:00
parent df75bf53e6
commit c5cc2a36e1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 11 additions and 7 deletions

View File

@ -14,7 +14,7 @@
(require 'lang-rust)
;; (require 'lang-yaml)
(require 'lang-yaml)
;; (require 'lang-org)

View File

@ -43,9 +43,9 @@
)
:init
(add-to-list 'major-mode-remap-alist '(rust-mode . rust-ts-mode))
:config
(add-to-list 'treesit-language-source-alist '(rust "https://github.com/tree-sitter/tree-sitter-rust"))
(treesit-install-language-grammar 'rust)
:config
;; Add keybindings for interacting with Cargo
(use-package cargo
:hook (rust-ts-mode . cargo-minor-mode))

View File

@ -15,12 +15,12 @@
(use-package yaml-mode
:mode
(("playbook\\.tmp\\'" . yaml-mode)
("environments/[^/]*/group_vars/[^/]*\\'" . yaml-mode)
("environments/[^/]*/host_vars/[^/]*\\'" . yaml-mode)
(("playbook\\.tmp\\'" . yaml-ts-mode)
("environments/[^/]*/group_vars/[^/]*\\'" . yaml-ts-mode)
("environments/[^/]*/host_vars/[^/]*\\'" . yaml-ts-mode)
)
:hook (
(yaml-mode . (lambda ()
(yaml-ts-mode . (lambda ()
(setq eglot-workspace-configuration
(list (cons ':yaml (list ':hover :json-false :validate :json-false :completion t))))
(eglot-ensure)
@ -28,8 +28,12 @@
))
)
;; :bind (
;; (:map yaml-mode-map ([backspace] . yaml-backspace))
;; (:map yaml-ts-mode-map ([backspace] . yaml-backspace))
;; )
:init
(add-to-list 'major-mode-remap-alist '(yaml-mode . yaml-ts-mode))
(add-to-list 'treesit-language-source-alist '(yaml "https://github.com/ikatyang/tree-sitter-yaml"))
(treesit-install-language-grammar 'yaml)
)
(provide 'lang-yaml)