mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/web: more sensible html-tidy formatter config
+ No longer inserts html/body tags unless they're detected in the buffer + Respect tab-width and indent-tab-mode + Don't auto-remove empty elements
This commit is contained in:
@ -17,6 +17,18 @@
|
||||
:config
|
||||
(set-docsets! 'web-mode "HTML" "Twig" "WordPress")
|
||||
|
||||
;; tidy is already defined by the format-all package. We redefine it to add
|
||||
;; more sensible arguments to the tidy command.
|
||||
(set-formatter! 'html-tidy
|
||||
'("tidy" "-q" "-indent"
|
||||
"--tidy-mark" "no"
|
||||
"--drop-empty-elements" "no"
|
||||
"--show-body-only" "auto"
|
||||
("--indent-spaces" "%d" tab-width)
|
||||
("--indent-with-tabs" "%s" (if indent-tabs-mode "yes" "no"))
|
||||
("-xml" (memq major-mode '(nxml-mode xml-mode))))
|
||||
:ok-statuses '(0 1))
|
||||
|
||||
(setq web-mode-enable-html-entities-fontification t
|
||||
web-mode-auto-close-style 2)
|
||||
|
||||
|
Reference in New Issue
Block a user