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:
parent
df42d8ce89
commit
b697ad982e
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue