nit(format): move formatter configs to bottom

There will likely be more of these later, so I move them to the bottom
of the :config block.
This commit is contained in:
Henrik Lissner 2024-08-16 14:58:33 -04:00
parent 7499995643
commit f6040832e5
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -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)))