]> code.delx.au - gnu-emacs-elpa/blob - README.md
Move up the screencast
[gnu-emacs-elpa] / README.md
1 aggressive-indent-mode
2 ======================
3
4 `electric-indent-mode` is enough to keep your code nicely aligned when
5 all you do is type. However, once you start shifting blocks around,
6 transposing lines, or slurping and barfing sexps, indentation is bound
7 to go wrong.
8
9 **`aggressive-indent-mode`** is a minor mode that keeps your code **always**
10 indented. It reindents after every command, making it more reliable
11 than `electric-indent-mode`.
12
13 ### Demonstration ###
14
15 ![aggressive-indent](aggressive-indent.gif)
16
17 ### Instructions ###
18
19 This package is available fom Melpa, you may install it by calling
20
21 M-x package-install RET aggressive-indent
22
23 Then activate it with
24
25 (add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)
26 (add-hook 'css-mode-hook #'aggressive-indent-mode)
27
28 You can use this hook on any mode you want, `aggressive-indent` is not
29 exclusive to emacs-lisp code. In fact, if you want to turn it on for
30 every programming mode, you can do something like:
31
32 (global-aggressive-indent-mode 1)
33 (add-to-list 'aggressive-indent-excluded-modes 'html-mode)
34
35
36 *Plase Note:* `aggressive-indent` works superbly with lisp-like modes
37 (where `end-of-defun`) works very nicely. However, in some c-like
38 modes aggressive-indent
39 [might cause some lag](https://github.com/Bruce-Connor/aggressive-indent-mode/issues/7),
40 I'm working on that.
41
42 ### Manual Installation ###
43
44 If you don't want to install from Melpa, you can download it manually,
45 place it in your `load-path` and require it with
46
47 (require 'aggressive-indent)