feat(format): add :lang data formatter

This commit is contained in:
Ellis Kenyő 2022-08-16 08:19:02 +01:00 committed by Ellis Kenyo
parent 53fe5df6b5
commit f80f52ba4f
No known key found for this signature in database
GPG key ID: 298BE5D997EBAA02
2 changed files with 8 additions and 1 deletions

View file

@ -8,7 +8,9 @@
(setq nxml-slash-auto-complete-flag t (setq nxml-slash-auto-complete-flag t
nxml-auto-insert-xml-declaration-flag t) nxml-auto-insert-xml-declaration-flag t)
(set-company-backend! 'nxml-mode '(company-nxml company-yasnippet)) (set-company-backend! 'nxml-mode '(company-nxml company-yasnippet))
(setq-hook! 'nxml-mode-hook tab-width nxml-child-indent)) (setq-hook! 'nxml-mode-hook tab-width nxml-child-indent)
(when (executable-find "xmllint")
(set-formatter! 'xmllint '("xmllint" "--format" "-") :modes '(nxml-mode))))
;;;###package csv-mode ;;;###package csv-mode

View file

@ -0,0 +1,5 @@
;;; lang/data/doctor.el -*- lexical-binding: t; -*-
(when (modulep! :editor format)
(unless (executable-find "xmllint")
(warn! "Couldn't find xmllint. Formatting will be disabled.")))