mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(language/toml): use toml-ts-mode if available
This commit is contained in:
@@ -11,12 +11,25 @@
|
||||
(use-package conf-toml-mode
|
||||
:straight (:type built-in)
|
||||
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
||||
:hook (conf-toml-mode . siren-toml-mode-setup)
|
||||
:hook (conf-toml-mode . siren-toml-mode-setup))
|
||||
|
||||
:preface
|
||||
(defun siren-toml-mode-setup ()
|
||||
(run-hooks 'prog-mode-hook)
|
||||
(setq-local tab-width 2)))
|
||||
;; Use built-in treesit support if available.
|
||||
(if (fboundp 'toml-ts-mode)
|
||||
(use-package toml-ts-mode
|
||||
:straight (:type built-in)
|
||||
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
||||
:hook
|
||||
(toml-ts-mode . siren-toml-mode-setup)
|
||||
|
||||
:init
|
||||
(require 'siren-treesit)
|
||||
(siren-treesit-prepare
|
||||
'toml-ts-mode
|
||||
'(toml "https://github.com/tree-sitter/tree-sitter-toml"))))
|
||||
|
||||
(defun siren-toml-mode-setup ()
|
||||
(run-hooks 'prog-mode-hook)
|
||||
(setq-local tab-width 2))
|
||||
|
||||
(provide 'siren-toml)
|
||||
;;; siren-toml.el ends here
|
||||
|
||||
Reference in New Issue
Block a user