diff --git a/modules/editor/format/config.el b/modules/editor/format/config.el index 13278cfe6..57f58ee19 100644 --- a/modules/editor/format/config.el +++ b/modules/editor/format/config.el @@ -44,14 +44,6 @@ This is controlled by `+format-on-save-disabled-modes'." (add-to-list 'doom-debug-variables '(apheleia-log-only-errors . nil)) (add-to-list 'doom-debug-variables '(apheleia-log-debug-info . t)) - (add-to-list 'apheleia-mode-alist '(sh-mode . shfmt)) - - ;; A psuedo-formatter that dispatches to the appropriate LSP client (via - ;; `lsp-mode' or `eglot') that is capable of formatting. Without +lsp, users - ;; must manually set `+format-with' to `lsp' to use it, or activate - ;; `+format-with-lsp-mode' in the appropriate modes. - (add-to-list 'apheleia-formatters '(lsp . +format-lsp-buffer)) - (defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg) "Make it so \\[save-buffer] with prefix arg inhibits reformatting." :around #'save-buffer @@ -70,4 +62,18 @@ This is controlled by `+format-on-save-disabled-modes'." (font-lock-fontify-region web-mode-scan-beg web-mode-scan-end))))) (defun +format--update-vc-gutter-h () (when (fboundp '+vc-gutter-update-h) - (+vc-gutter-update-h))))) + (+vc-gutter-update-h)))) + + + ;; + ;; Custom formatters + + ;; Apheleia already has a definition for shfmt, but doesn't assign it to any + ;; major modes, so... + (add-to-list 'apheleia-mode-alist '(sh-mode . shfmt)) + + ;; A psuedo-formatter that dispatches to the appropriate LSP client (via + ;; `lsp-mode' or `eglot') that is capable of formatting. Without +lsp, users + ;; must manually set `+format-with' to `lsp' to use it, or activate + ;; `+format-with-lsp-mode' in the appropriate modes. + (add-to-list 'apheleia-formatters '(lsp . +format-lsp-buffer)))