Change apheleia stupid indenting
This commit is contained in:
parent
b954ae483d
commit
0165cc6bfc
26
init.el
26
init.el
|
@ -964,30 +964,26 @@ specific to most general, they are these:
|
|||
(setup (:straight (apheleia
|
||||
:host github
|
||||
:repo "raxod502/apheleia"))
|
||||
|
||||
(apheleia-global-mode +1)
|
||||
|
||||
;; Use a dumb formatter on modes that `apheleia' doesn't work for.
|
||||
(add-hook 'before-save-hook
|
||||
(defun before-save@dumb-auto-format ()
|
||||
(setq stupid-modes '(makefile-mode
|
||||
org-mode))
|
||||
;; If there's no apheleia formatter for the mode, just indent the
|
||||
;; buffer.
|
||||
(unless (or (apply #'derived-mode-p stupid-modes)
|
||||
(and (fboundp 'apheleia--get-formatter-command)
|
||||
(apheleia--get-formatter-command)))
|
||||
(indent-region (point-min) (point-max))))))
|
||||
(:also-load acdw-apheleia)
|
||||
(add-hook 'before-save-hook #'apheleia-dumb-auto-format)
|
||||
|
||||
;; Aphelia can't find prettier on Windows (though I
|
||||
;; installed it, I think), and it keeps trying to start
|
||||
;; new processes until Emacs runs out of subprocess space.
|
||||
;; So I just enable it at home.
|
||||
(unless (acdw/system :work)
|
||||
(apheleia-global-mode +1)))
|
||||
|
||||
(setup (:straight async)
|
||||
(dired-async-mode +1))
|
||||
|
||||
(setup (:straight avy)
|
||||
(:global "C-'" #'avy-goto-char-timer
|
||||
(:global "M-j" #'avy-goto-char-timer
|
||||
"C-c C-j" #'avy-resume)
|
||||
|
||||
(:with-feature isearch
|
||||
(:bind "C-'" #'avy-isearch)))
|
||||
(:bind "M-j" #'avy-isearch)))
|
||||
|
||||
(setup (:straight circe)
|
||||
(require 'circe)
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
;;; acdw-apheleia.el --- bespoke apheleia junk -*- lexical-binding: t -*-
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'apheleia)
|
||||
|
||||
(defcustom apheleia-stupid-modes '(makefile-mode
|
||||
org-mode)
|
||||
"List of stupid modes to not use `apheleia-global-mode' on."
|
||||
:type '(repeat function)
|
||||
:group 'apheleia)
|
||||
|
||||
(defun apheleia-dumb-auto-format ()
|
||||
"Format a buffer dumbly."
|
||||
;; If there's no apheleia formatter for the mode, just indent the
|
||||
;; buffer.
|
||||
(unless (or (apply #'derived-mode-p apheleia-stupid-modes)
|
||||
(and (fboundp 'apheleia--get-formatter-command)
|
||||
(apheleia--get-formatter-command)))
|
||||
(indent-region (point-min) (point-max))))
|
||||
|
||||
(provide 'acdw-apheleia)
|
||||
;;; acdw-apheleia ends here
|
Loading…
Reference in New Issue