mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-04 15:03:42 -05:00
feat(yaml): add treesit support
This commit is contained in:
@@ -2,10 +2,22 @@
|
||||
|
||||
(use-package! yaml-mode
|
||||
:mode "Procfile\\'"
|
||||
:init
|
||||
:config
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'yaml-mode-local-vars-hook #'lsp! 'append))
|
||||
(when (modulep! +tree-sitter)
|
||||
(add-hook 'yaml-mode-local-vars-hook #'tree-sitter! 'append))
|
||||
:config
|
||||
(setq-hook! 'yaml-mode-hook tab-width yaml-indent-offset))
|
||||
|
||||
|
||||
(use-package! yaml-ts-mode
|
||||
:when (modulep! +tree-sitter)
|
||||
:when (fboundp 'yaml-ts-mode) ; 29.1+ only
|
||||
:init
|
||||
(set-tree-sitter! 'yaml-mode 'yaml-ts-mode
|
||||
'((yaml :url "https://github.com/tree-sitter-grammars/tree-sitter-yaml"
|
||||
:rev "v0.7.0")))
|
||||
:config
|
||||
;; HACK: Rely on `major-mode-remap-defaults'.
|
||||
(cl-callf2 rassq-delete-all 'yaml-ts-mode auto-mode-alist)
|
||||
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'yaml-ts-mode-local-vars-hook #'lsp! 'append)))
|
||||
|
Reference in New Issue
Block a user