From 9af70cbf60e78309a3902315a7d444877677fdfe Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 1 Apr 2021 16:41:41 -0500 Subject: Define `acdw/reindent-buffer' and hook into elisp Hopefully this will put a halt to all of my whitespace commits. Of course, this commit also includes whitespace-only diffs. --- init.el | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 5d0bc1b..12f25a6 100644 --- a/init.el +++ b/init.el @@ -391,7 +391,7 @@ ;;;;; MWIM (setup (:straight mwim) (:global "C-a" mwim-beginning - "C-e" mwim-end)) + "C-e" mwim-end)) ;;;;; Expand-region (setup (:straight expand-region) @@ -400,20 +400,20 @@ ;;;;; CRUX (setup (:straight crux) (:global "M-o" crux-other-window-or-switch-buffer - "C-k" crux-kill-and-join-forward - "C-o" crux-smart-open-line-above - "C-S-o" crux-smart-open-line - "C-M-\\" crux-cleanup-buffer-or-region - "C-c i" crux-find-user-init-file) + "C-k" crux-kill-and-join-forward + "C-o" crux-smart-open-line-above + "C-S-o" crux-smart-open-line + "C-M-\\" crux-cleanup-buffer-or-region + "C-c i" crux-find-user-init-file) (crux-reopen-as-root-mode +1)) ;;;;; AVY ... & friends (setup (:straight avy) (:global "C-:" avy-goto-char - "C-'" avy-goto-char-timer - "M-g f" avy-goto-line - "M-g w" avy-goto-word-1 - "C-c C-j" avy-resume) + "C-'" avy-goto-char-timer + "M-g f" avy-goto-line + "M-g w" avy-goto-word-1 + "C-c C-j" avy-resume) (eval-after-load "isearch" '(define-key isearch-mode-map (kbd "C-'") #'avy-isearch))) @@ -435,7 +435,7 @@ call `zzz-to-char'." (add-to-list 'mode-line-misc-info '(:eval (anzu--update-mode-line))) (:global [remap query-replace] anzu-query-replace - [remap query-replace-regexp] anzu-query-replace-regexp) + [remap query-replace-regexp] anzu-query-replace-regexp) (:with-map isearch-mode-map (:bind [remap isearch-query-replace] anzu-isearch-query-replace [remap isearch-query-replace-regexp] @@ -446,7 +446,7 @@ call `zzz-to-char'." ;;;;; smart hungry delete (setup (:straight smart-hungry-delete) (:global "" smart-hungry-delete-backward-char - "C-d" smart-hungry-delete-forward-char) + "C-d" smart-hungry-delete-forward-char) (smart-hungry-delete-add-default-hooks)) ;;;; Functionality @@ -458,8 +458,8 @@ call `zzz-to-char'." ;;;;; Undo-fu (setup (:straight undo-fu) - (:global "C-/" undo-fu-only-undo - "C-?" undo-fu-only-redo)) + (:global "C-/" undo-fu-only-undo + "C-?" undo-fu-only-redo)) (setup (:straight undo-fu-session) (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" @@ -733,7 +733,8 @@ if ripgrep is installed, otherwise `consult-grep'." (setup emacs-lisp-mode (:option eval-expression-print-length nil eval-expression-print-level nil - lisp-indent-function #'lisp-indent-function)) + lisp-indent-function #'lisp-indent-function) + (:local-hook before-save-hook acdw/reindent-buffer)) (setup (:straight macrostep) (define-key emacs-lisp-mode-map (kbd "C-c e") #'macrostep-expand)) -- cgit 1.4.1-21-gabe81