Add xml formatting to emacs.
This commit is contained in:
17
ansible/roles/emacs/files/elisp/lang-xml.el
Normal file
17
ansible/roles/emacs/files/elisp/lang-xml.el
Normal 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)
|
||||
@@ -34,4 +34,6 @@
|
||||
|
||||
(require 'lang-c)
|
||||
|
||||
(require 'lang-xml)
|
||||
|
||||
(load-directory autoload-directory)
|
||||
|
||||
Reference in New Issue
Block a user