@@ -78,6 +78,17 @@ The default indentation rules in `clojure-mode` are derived from the
7878[ community Clojure Style Guide] ( https://guide.clojure.style ) .
7979Please, refer to the guide for the general Clojure indentation rules.
8080
81+ If you'd like to use the alternative "fixed/tonsky" indentation style you should
82+ update your configuration accordingly:
83+
84+ ``` el
85+ (setq clojure-indent-style 'always-indent
86+ clojure-indent-keyword-style 'always-indent
87+ clojure-enable-indent-specs nil)
88+ ```
89+
90+ Read on for more details on the available indentation-related configuration options.
91+
8192#### Indentation of docstrings
8293
8394By default multi-line docstrings are indented with 2 spaces, as this is a
@@ -129,6 +140,44 @@ The indentation of function forms is configured by the variable
129140** Note:** Prior to clojure-mode 5.10, the configuration options for ` clojure-indent-style ` used to be
130141keywords, but now they are symbols. Keywords will still be supported at least until clojure-mode 6.
131142
143+ #### Indentation of keywords
144+
145+ Similarly we have the ` clojure-indent-keyword-style ` , which works in the following way:
146+
147+ * ` always-align ` (default) - All
148+ args are vertically aligned with the first arg in case (A),
149+ and vertically aligned with the function name in case (B).
150+
151+ ``` clojure
152+ (:require [foo.bar]
153+ [bar.baz])
154+ (:require
155+ [foo.bar]
156+ [bar.baz])
157+ ```
158+
159+ * ` always-indent ` - All args are indented like a macro body.
160+
161+ ``` clojure
162+ (:require [foo.bar]
163+ [bar.baz])
164+ (:x
165+ location
166+ 0 )
167+ ```
168+
169+
170+ * ` align-arguments ` - Case (A) is indented like ` always-align ` , and
171+ case (B) is indented like a macro body.
172+
173+ ``` clojure
174+ (:require [foo.bar]
175+ [bar.baz])
176+ (:x
177+ location
178+ 0 )"
179+ ```
180+
132181#### Indentation of macro forms
133182
134183The indentation of special forms and macros with bodies is controlled via
@@ -218,6 +267,12 @@ Setting `clojure-special-arg-indent-factor` to 1, results in:
218267 [my-field])
219268```
220269
270+ You can completely disable the effect of indentation specs like this:
271+
272+ ``` el
273+ (setq clojure-enable-indent-specs nil)
274+ ```
275+
221276#### Indentation of Comments
222277
223278`clojure-mode` differentiates between comments like `;`, `;;`, etc.
0 commit comments