about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-11-01 16:49:22 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-11-01 16:49:22 +0000
commita9cd2d7ed6c2ff5ff327580387120cfa691e712e (patch)
tree54f4ef9275b8f3567cf458273721c7d1769b529a
parent5c86112967546b8a0f766417ae25e7ef58593122 (diff)
downloaddotfiles-a9cd2d7ed6c2ff5ff327580387120cfa691e712e.tar.gz
Add aggressive-indent
-rw-r--r--.emacs.d/lisp/init-editor.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-editor.el b/.emacs.d/lisp/init-editor.el
index cb1fd63..ddc8a0b 100644
--- a/.emacs.d/lisp/init-editor.el
+++ b/.emacs.d/lisp/init-editor.el
@@ -171,6 +171,19 @@
   :diminish
   :hook (prog-mode . ws-butler-mode))
 
+(use-package aggressive-indent
+  :diminish
+  :config
+  (unbind-key "C-c C-q" aggressive-indent-mode-map)
+  ;; don't indent lisp comments
+  (add-to-list 'aggressive-indent-dont-indent-if
+               '(and (derived-mode-p 'prog-mode)
+                     (string-match "^\s*;"
+                                   (thing-at-point 'line))))
+  :hook
+  (emacs-lisp . aggressive-indent-mode)
+  (clojure-mode . aggressive-indent-mode))
+
 (use-package hungry-delete
   :diminish
   :hook (prog-mode . turn-on-hungry-delete-mode))