mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
feat(language/toml): switch to toml-ts-mode and enable lsp-mode as well
This commit is contained in:
@@ -9,13 +9,10 @@
|
||||
(use-package prettier-js
|
||||
:defer t
|
||||
:hook
|
||||
((conf-toml-mode
|
||||
css-mode
|
||||
((css-mode
|
||||
markdown-mode
|
||||
php-mode
|
||||
typescript-mode
|
||||
toml-mode
|
||||
toml-ts-mode
|
||||
vue-mode) . siren-prettier-js-mode-enable)
|
||||
|
||||
:custom
|
||||
|
||||
@@ -7,30 +7,46 @@
|
||||
;;; Code:
|
||||
|
||||
(require 'siren-prog-mode)
|
||||
|
||||
;; TODO: Revisit toml-ts-mode at some point the future. It's a bit buggy at the
|
||||
;; moment.
|
||||
;;
|
||||
;; (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)
|
||||
;; :preface
|
||||
;; (require 'siren-treesit)
|
||||
;; :config
|
||||
;; (siren-treesit-auto-ensure-grammar 'toml)))
|
||||
|
||||
(use-package conf-toml-mode
|
||||
:straight (:type built-in)
|
||||
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
||||
:hook (conf-toml-mode . siren-toml-mode-setup))
|
||||
(require 'siren-treesit)
|
||||
|
||||
(defun siren-toml-mode-setup ()
|
||||
"Default tweaks for `toml-mode'."
|
||||
(run-hooks 'prog-mode-hook)
|
||||
(setq-local tab-width 2))
|
||||
|
||||
(use-package conf-toml-mode
|
||||
:straight (:type built-in)
|
||||
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
||||
:hook
|
||||
(conf-toml-mode . siren-toml-mode-setup))
|
||||
|
||||
(if (fboundp 'toml-ts-mode)
|
||||
(use-package toml-ts-mode
|
||||
:straight (:type built-in)
|
||||
;; TODO: Revisit toml-ts-mode at some point the future. It's a bit buggy
|
||||
;; at the moment.
|
||||
:mode "\\.toml\\'" "Cargo\\.lock\\'"
|
||||
|
||||
:hook
|
||||
(toml-ts-mode . siren-toml-mode-setup)
|
||||
|
||||
:custom
|
||||
(toml-ts-mode-indent-offset 2)
|
||||
|
||||
:config
|
||||
(siren-treesit-auto-ensure-grammar 'toml)))
|
||||
|
||||
(use-package lsp-toml
|
||||
:straight lsp-mode
|
||||
:hook
|
||||
(toml-mode . siren-lsp-lua-mode-setup)
|
||||
(toml-ts-mode . siren-lsp-lua-mode-setup)
|
||||
|
||||
:preface
|
||||
(defun siren-lsp-lua-mode-setup ()
|
||||
(lsp-format-buffer-on-save-mode t)
|
||||
(lsp-deferred))
|
||||
)
|
||||
|
||||
(provide 'siren-toml)
|
||||
;;; siren-toml.el ends here
|
||||
|
||||
Reference in New Issue
Block a user