]> code.delx.au - gnu-emacs-elpa/blob - README.md
Add more excluded modes
[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 - An example of Lisp mode (Emacs Lisp):
16 ![Lisp Code Example](lisp-example.gif)
17
18 - An example of non-Lisp mode (C++):
19 ![Cpp Code Example](cpp-example.gif)
20
21 ### Instructions ###
22
23 This package is available fom Melpa, you may install it by calling
24
25 M-x package-install RET aggressive-indent
26
27 Then activate it with
28
29 (add-hook 'emacs-lisp-mode-hook #'aggressive-indent-mode)
30 (add-hook 'css-mode-hook #'aggressive-indent-mode)
31
32 You can use this hook on any mode you want, `aggressive-indent` is not
33 exclusive to emacs-lisp code. In fact, if you want to turn it on for
34 every programming mode, you can do something like:
35
36 (global-aggressive-indent-mode 1)
37 (add-to-list 'aggressive-indent-excluded-modes 'html-mode)
38
39 ### Manual Installation ###
40
41 If you don't want to install from Melpa, you can download it manually,
42 place it in your `load-path` along with its two dependencies:
43
44 - [Names](https://github.com/Bruce-Connor/names/)
45 - and `cl-lib` (which you should already have if your `emacs-version` is at least 24.3).
46
47 Then require it with:
48
49 (require 'aggressive-indent)