Files
.emacs.d/modules/languages/siren-caddyfile.el
Jim Myhrberg 646876f1cd feat(language/caddyfile): format on save, use tab indentation
Caddy can now format Caddyfiles with the "caddy fmt" command, so we use
reformatter to create a format-on-save mode for Caddyfiles.

Also there's no need for the weird whitespace-mode workaround, as we now
use tab indentation in Caddyfiles, since that's what "caddy fmt"
produces.
2022-07-30 21:56:24 +01:00

31 lines
650 B
EmacsLisp

;;; siren-caddyfile.el --- jimeh's Emacs Siren: caddyfile-mode configuration.
;;; Commentary:
;; Basic configuration for caddyfile-mode.
;;; Code:
(use-package caddyfile-mode
:mode
("Caddyfile\\'" . caddyfile-mode)
("caddy\\.conf\\'" . caddyfile-mode)
("\\.caddy\\'" . caddyfile-mode)
:hook
(caddyfile-mode . siren-caddyfile-mode-setup)
:preface
(defun siren-caddyfile-mode-setup ()
(setq-local tab-width 4)
(caddyfile-format-on-save-mode t))
:config
(reformatter-define caddyfile-format
:program "caddy"
:args '("fmt" "-")
:lighter " fmt"))
(provide 'siren-caddyfile)
;;; siren-caddyfile.el ends here