Add xml formatting to emacs.
This commit is contained in:
parent
c36568462f
commit
5823ca90f1
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)
|
||||
|
@ -32,5 +32,6 @@
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"black-formatter.importStrategy": "fromEnvironment",
|
||||
"workbench.statusBar.visible": false
|
||||
"workbench.statusBar.visible": false,
|
||||
"git.openRepositoryInParentFolders": "never"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user