emacs: enable auto-formatting of dnscontrol configurations
Alan Pearce alan@alanpearce.eu
Sun, 09 Feb 2025 16:48:20 +0100
1 files changed, 7 insertions(+), 0 deletions(-)
jump to
M user/emacs/init.el → user/emacs/init.el
@@ -888,6 +888,12 @@ (use-package astro-ts-mode :mode (("\\.astro\\'" . astro-ts-mode))) +(define-derived-mode dnscontrol-mode typescript-ts-mode "DNSControl" + "Major mode for editing configuration of DNSControl." + (if (featurep 'apheleia) + (setq-local apheleia-formatter 'dnscontrol))) +(add-to-list 'auto-mode-alist '("dnsconfig.js\\'" . dnscontrol-mode)) + (autoload 'ansi-color-apply-on-region "ansi-color") (defun colourise-compilation-buffer () (ansi-color-apply-on-region compilation-filter-start (point-max))) @@ -1321,6 +1327,7 @@ (setf (alist-get 'shfmt apheleia-formatters) '("shfmt")) (setq apheleia-formatters (append apheleia-formatters '((nixpkgs-fmt "nixpkgs-fmt") + (dnscontrol "dnscontrol" "fmt") (golines "golines") (taplo "taplo" "format" "-") (prettier-gotmpl