Use aggressive indent mode
authorJoerg Jaspert <joerg@debian.org>
Mon, 27 Oct 2014 12:17:20 +0000 (13:17 +0100)
committerJoerg Jaspert <joerg@debian.org>
Mon, 27 Oct 2014 12:17:20 +0000 (13:17 +0100)
.emacs.d/config/emacs.org

index 89fb462..2d67823 100644 (file)
@@ -1084,6 +1084,26 @@ Use H-w to switch windows
   :commands ace-window
   :bind ("H-w" . ace-window))
 #+END_SRC
+** aggressive-indent
+[2014-10-27 Mon 13:08]
+electric-indent-mode is enough to keep your code nicely aligned when
+all you do is type. However, once you start shifting blocks around,
+transposing lines, or slurping and barfing sexps, indentation is bound
+to go wrong.
+
+aggressive-indent-mode is a minor mode that keeps your code always
+indented. It reindents after every command, making it more reliable
+than electric-indent-mode.
+#+BEGIN_SRC emacs-lisp :tangle yes
+(use-package aggressive-indent
+  :ensure aggressive-indent
+  :config
+  (progn
+    (global-aggressive-indent-mode 1)
+    (setq aggressive-indent-comments-too 1)
+    (add-to-list 'aggressive-indent-excluded-modes 'html-mode)
+    ))
+#+END_SRC
 ** anzu
 [2014-06-01 Sun 23:02]
 #+BEGIN_SRC emacs-lisp :tangle yes