@@ -5,68 +5,117 @@ INTRODUCTION *clojure-introduction*
5
5
Clojure runtime files for Vim.
6
6
7
7
8
- CLOJURE *ft-clojure-indent* *clojure-indent*
8
+ CLOJURE *ft-clojure-indent* *clojure-indent*
9
9
10
- By default Clojure.vim will attempt to follow the indentation rules in the
11
- Clojure Style Guide, [1] but various configuration options are provided to
12
- alter the indentation as you prefer.
10
+ Clojure indentation differs somewhat from traditional Lisps, due in part to
11
+ the use of square and curly brackets, and otherwise by community convention.
12
+ As these conventions are not universally followed, the Clojure indent script
13
+ offers ways to adjust the indentation.
13
14
14
- [1]: https://guide.clojure.style
15
15
16
- WARNING: if your installation of Vim does not include `searchpairpos ()` , the
17
- indent script falls back to normal 'lisp' and 'lispwords' indenting,
18
- ignoring the following indentation options.
16
+ *g:clojure_indent_style*
17
+ *b:clojure_indent_style*
19
18
20
- *b:clojure_indent_rules*
21
- *g:clojure_indent_rules*
19
+ The `clojure_indent_style` config option controls the general indentation style
20
+ to use. Choose from several common presets:
22
21
23
- TODO: add this option and write this section.
22
+ * `standard` (default):
23
+ Conventional Clojure indentation. (Clojure Style Guide [1]) >
24
+
25
+ (my-fn 1
26
+ 2)
24
27
25
- *b:clojure_align_multiline_strings*
26
- *g:clojure_align_multiline_strings*
28
+ (my-fn
29
+ 1
30
+ 2)
31
+ <
32
+ * `traditional` :
33
+ Indent like traditional Lisps. >
34
+
35
+ (my-fn 1
36
+ 2)
27
37
28
- Alter alignment of newly created lines within multi-line strings (and regular
29
- expressions).
38
+ (my-fn
39
+ 1
40
+ 2)
41
+ <
42
+ * `uniform` :
43
+ Indent uniformly to 2 spaces with no alignment (aka Tonsky indentation [2]).
30
44
>
31
- ;; let g:clojure_align_multiline_strings = 0 " Default
32
- (def default
33
- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
34
- eiusmod tempor incididunt ut labore et dolore magna aliqua.")
35
-
36
- ;; let g:clojure_align_multiline_strings = 1
37
- (def aligned
38
- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
39
- eiusmod tempor incididunt ut labore et dolore magna aliqua.")
40
-
41
- ;; let g:clojure_align_multiline_strings = -1
42
- (def traditional
43
- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
44
- eiusmod tempor incididunt ut labore et dolore magna aliqua.")
45
+ (my-fn 1
46
+ 2)
47
+
48
+ (my-fn
49
+ 1
50
+ 2)
45
51
<
46
- NOTE: indenting the string with | = | will not alter the indentation of existing
47
- multi-line strings as that would break intentional formatting.
52
+ [1]: https://guide.clojure.style/
53
+ [2]: https://tonsky.me/blog/clojurefmt/
54
+
55
+
56
+ *g:clojure_indent_rules*
57
+ *b:clojure_indent_rules*
58
+
59
+ TODO: add this option and write this section.
60
+
48
61
49
- *g:clojure_align_subforms*
62
+ *g:clojure_fuzzy_indent_patterns*
63
+ *b:clojure_fuzzy_indent_patterns*
50
64
51
- By default, parenthesized compound forms that look like function calls and
52
- whose head subform is on its own line have subsequent subforms indented by
53
- two spaces relative to the opening paren:
65
+ TODO: add this option and write this section.
66
+
67
+
68
+ *g:clojure_indent_multiline_strings*
69
+ *b:clojure_indent_multiline_strings*
70
+
71
+ Control alignment of new lines within Clojure multi-line strings and regular
72
+ expressions with `clojure_indent_multiline_strings` .
73
+
74
+ NOTE: indenting with | = | will not alter the indentation within multi-line
75
+ strings, as this could break intentional formatting.
76
+
77
+ Pick from the following multi-line string indent styles:
78
+
79
+ * `standard` (default):
80
+ Align to the front of the `" ` or `#" ` delimiter. Ideal for doc-strings.
54
81
>
55
- (foo
56
- bar
57
- baz )
82
+ |(def standard
83
+ | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
84
+ | eiusmod tempor incididunt ut labore et dolore magna aliqua." )
58
85
<
59
- Setting this option to `1 ` changes this behaviour so that all subforms are
60
- aligned to the same column, emulating the default behaviour of
61
- clojure-mode.el:
86
+ * `pretty` :
87
+ Align to the back of the `" ` or `#" ` delimiter.
62
88
>
63
- (foo
64
- bar
65
- baz )
89
+ |(def aligned
90
+ | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
91
+ | eiusmod tempor incididunt ut labore et dolore magna aliqua." )
66
92
<
93
+ * `traditional` :
94
+ No indent, align to left edge of the file.
95
+ >
96
+ |(def traditional
97
+ | "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
98
+ |eiusmod tempor incididunt ut labore et dolore magna aliqua.")
99
+ <
100
+
101
+ *clojure-indent-deprecations*
102
+
103
+ During the Clojure indentation script rebuild, the following configuration
104
+ options were removed/replaced:
105
+
106
+ * *g:clojure_maxlines* -> none
107
+ * *g:clojure_cljfmt_compat*: -> | g:clojure_indent_style |
108
+ * *g:clojure_align_subforms* -> | g:clojure_indent_style |
109
+ * *g:clojure_align_multiline_strings* -> | g:clojure_indent_multiline_strings |
110
+ * *g:clojure_special_indent_words*: -> | g:clojure_indent_rules |
111
+ * *g:clojure_fuzzy_indent*: -> none
112
+ * *g:clojure_fuzzy_indent_blacklist*: -> none
113
+ * | 'lispwords' | -> | g:clojure_indent_rules |
114
+
67
115
68
116
CLOJURE *ft-clojure-syntax*
69
117
118
+
70
119
*g:clojure_syntax_keywords*
71
120
72
121
Syntax highlighting of public vars in "clojure.core" is provided by default,
0 commit comments