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:
parent
7499995643
commit
f6040832e5
1 changed files with 15 additions and 9 deletions
|
@ -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-only-errors . nil))
|
||||||
(add-to-list 'doom-debug-variables '(apheleia-log-debug-info . t))
|
(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)
|
(defadvice! +format--inhibit-reformat-on-prefix-arg-a (orig-fn &optional arg)
|
||||||
"Make it so \\[save-buffer] with prefix arg inhibits reformatting."
|
"Make it so \\[save-buffer] with prefix arg inhibits reformatting."
|
||||||
:around #'save-buffer
|
: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)))))
|
(font-lock-fontify-region web-mode-scan-beg web-mode-scan-end)))))
|
||||||
(defun +format--update-vc-gutter-h ()
|
(defun +format--update-vc-gutter-h ()
|
||||||
(when (fboundp '+vc-gutter-update-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)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue