diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/init.el b/init.el index 0f235b3..023faa3 100644 --- a/init.el +++ b/init.el | |||
@@ -729,14 +729,21 @@ if ripgrep is installed, otherwise `consult-grep'." | |||
729 | ;;;;; Formatting | 729 | ;;;;; Formatting |
730 | (setup (:straight (apheleia :host github | 730 | (setup (:straight (apheleia :host github |
731 | :repo "raxod502/apheleia")) | 731 | :repo "raxod502/apheleia")) |
732 | (apheleia-global-mode +1)) | 732 | (apheleia-global-mode +1) |
733 | |||
734 | ;; Use a dumb formatter on modes that `apheleia' doesn't work for. | ||
735 | (defun dumb-auto-format () | ||
736 | "Run `indent-region' in buffers that don't have an | ||
737 | `apheleia' formatter set." | ||
738 | (unless (apheleia--get-formatter-command) | ||
739 | (indent-region (point-min) (point-max)))) | ||
740 | (add-hook 'before-save-hook #'dumb-auto-format)) | ||
733 | 741 | ||
734 | ;;;;; Emacs lisp | 742 | ;;;;; Emacs lisp |
735 | (setup emacs-lisp-mode | 743 | (setup emacs-lisp-mode |
736 | (:option eval-expression-print-length nil | 744 | (:option eval-expression-print-length nil |
737 | eval-expression-print-level nil | 745 | eval-expression-print-level nil |
738 | lisp-indent-function #'lisp-indent-function) | 746 | lisp-indent-function #'lisp-indent-function)) |
739 | (:local-hook before-save-hook acdw/reindent-buffer)) | ||
740 | 747 | ||
741 | (setup (:straight macrostep) | 748 | (setup (:straight macrostep) |
742 | (define-key emacs-lisp-mode-map (kbd "C-c e") #'macrostep-expand)) | 749 | (define-key emacs-lisp-mode-map (kbd "C-c e") #'macrostep-expand)) |