Add xml formatting to emacs.

This commit is contained in:
Tom Alexander 2024-06-03 18:59:16 -04:00
parent c36568462f
commit 5823ca90f1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,17 @@
(defun xml-fmt ()
"Run xmllint --format."
(run-command-on-buffer "xmllint" "--format" "-")
)
(use-package nxml-mode
:commands (nxml-mode)
:pin manual
:ensure nil
:hook (
(nxml-mode . (lambda ()
(add-hook 'before-save-hook 'xml-fmt nil 'local)
))
)
)
(provide 'lang-xml)

View File

@ -34,4 +34,6 @@
(require 'lang-c) (require 'lang-c)
(require 'lang-xml)
(load-directory autoload-directory) (load-directory autoload-directory)

View File

@ -32,5 +32,6 @@
"editor.formatOnSave": true "editor.formatOnSave": true
}, },
"black-formatter.importStrategy": "fromEnvironment", "black-formatter.importStrategy": "fromEnvironment",
"workbench.statusBar.visible": false "workbench.statusBar.visible": false,
"git.openRepositoryInParentFolders": "never"
} }