Add snippet to start prism-whitespace-mode for XML and YAML files

This commit is contained in:
Bram Schoenmakers 2023-05-21 13:03:45 +02:00
parent efab4c386e
commit ebb9a7c949
2 changed files with 26 additions and 0 deletions

View file

@ -564,6 +564,22 @@ An improved version was [[https://github.com/xenodium/dwim-shell-command/commit/
'my/not-applied))
#+end_src
* Enable prism-whitespace-mode for XML and YAML
#+begin_src elisp :tangle gists/prism-xml-yaml.el
;; Enable prism-whitespace-mode for YAML and XML automatically. Detect
;; the amounh of whitespace from the respective mode.
(use-package prism
:config
(add-to-list 'prism-whitespace-mode-indents '(yaml-mode . yaml-indent-offset))
(add-to-list 'prism-whitespace-mode-indents '(nxml-mode . nxml-child-indent))
:hook
(yaml-mode . prism-whitespace-mode)
(nxml-mode . prism-whitespace-mode))
#+end_src
* Meta
** License

10
gists/prism-xml-yaml.el Normal file
View file

@ -0,0 +1,10 @@
;; Enable prism-whitespace-mode for YAML and XML automatically. Detect
;; the amounh of whitespace from the respective mode.
(use-package prism
:config
(add-to-list 'prism-whitespace-mode-indents '(yaml-mode . yaml-indent-offset))
(add-to-list 'prism-whitespace-mode-indents '(nxml-mode . nxml-child-indent))
:hook
(yaml-mode . prism-whitespace-mode)
(nxml-mode . prism-whitespace-mode))