Skip to content

Commit 3c5258c

Browse files
committed
Replace the old multi-line string config option
1 parent 3487e07 commit 3c5258c

File tree

11 files changed

+93
-37
lines changed

11 files changed

+93
-37
lines changed

README.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ offers ways to adjust the indentaion.
6666
> The indentation code has recently been rebuilt which included the removal of
6767
> the following configuration options:
6868
>
69+
> - `clojure_align_multiline_strings`
6970
> - `clojure_fuzzy_indent`
7071
> - `clojure_fuzzy_indent_blacklist`
7172
> - `clojure_special_indent_words`
@@ -85,43 +86,40 @@ to use. Choose from several common presets:
8586
| `uniform` | | Indent uniformly to 2 spaces with no alignment (a.k.a. [_Tonsky_ indentation](https://tonsky.me/blog/clojurefmt/)). |
8687

8788
```vim
88-
let g:clojure_indent_style = 'uniform' " Set the default indent style...
89-
let b:clojure_indent_style = 'traditional' " ...or override the default per-buffer.
89+
let g:clojure_indent_style = 'uniform' " Set the default...
90+
let b:clojure_indent_style = 'traditional' " ...or override it per-buffer.
9091
```
9192

9293

9394
### Indentation rules
9495

95-
`clojure_indent_rules`
96+
> [!NOTE]
97+
> These options are ignored if an indentation style of "uniform" is selected.
98+
99+
`clojure_indent_rules` & `clojure_fuzzy_indent_patterns`
96100

97101

98102
### Multi-line strings
99103

100104
Control alignment of _new_ lines within Clojure multi-line strings and regular
101-
expressions with `clojure_align_multiline_strings`.
105+
expressions with `clojure_indent_multiline_strings`.
102106

103107
> [!NOTE]
104108
> Indenting with `=` will not alter the indentation within multi-line strings,
105109
> as this could break intentional formatting.
106110
107-
```clojure
108-
;; let g:clojure_align_multiline_strings = 0 " Default
109-
(def default
110-
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
111-
eiusmod tempor incididunt ut labore et dolore magna aliqua.")
112-
113-
;; let g:clojure_align_multiline_strings = 1
114-
(def aligned
115-
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
116-
eiusmod tempor incididunt ut labore et dolore magna aliqua.")
117-
118-
;; let g:clojure_align_multiline_strings = -1
119-
(def traditional
120-
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
121-
eiusmod tempor incididunt ut labore et dolore magna aliqua.")
122-
```
111+
Pick from the following multi-line string indent styles:
112+
113+
| Value | Default | Description |
114+
|-------|---------|-------------|
115+
| `standard` || Align to the _front_ of the `"` or `#"` delimiter. Ideal for doc-strings. |
116+
| `pretty` | | Align to the _back_ of the `"` or `#"` delimiter. |
117+
| `traditional` | | No indent: align to left edge of file. |
123118

124-
There is also a buffer-local (`b:`) version of this option.
119+
```vim
120+
let g:clojure_indent_multiline_strings = 'pretty' " Set the default...
121+
let b:clojure_indent_multiline_strings = 'traditional' " ...or override it per-buffer.
122+
```
125123

126124

127125
## Code folding
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{:extra-cmds ["let g:clojure_align_multiline_strings = 0"
1+
{:extra-cmds ["let g:clojure_indent_multiline_strings = 'pretty'"
22
"normal! G"
33
"normal! o\u000atest \"hello\u000aworld\""
44
"normal! o\u000aregex #\"asdf\u000abar\""]}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{:extra-cmds ["let g:clojure_align_multiline_strings = 1"
1+
{:extra-cmds ["let g:clojure_indent_multiline_strings = 'standard'"
22
"normal! G"
33
"normal! o\u000atest \"hello\u000aworld\""
44
"normal! o\u000aregex #\"asdf\u000abar\""]}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{:extra-cmds ["let g:clojure_indent_multiline_strings = 'traditional'"
2+
"normal! G"
3+
"normal! o\u000atest \"hello\u000aworld\""
4+
"normal! o\u000aregex #\"asdf\u000abar\""]}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"foo
2+
bar"
3+
4+
asdf dfa sdfasdf "
5+
asdf"
6+
7+
(asdf [foo]
8+
"hel
9+
lo asd
10+
fasdfa
11+
sdf
12+
asdf
13+
as
14+
as
15+
asdf
16+
df
17+
df
18+
world")
19+
20+
#{:foo :bar
21+
:biz
22+
"ba
23+
z"}
24+
25+
#"foo
26+
bar
27+
biz"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"foo
2+
bar"
3+
4+
asdf dfa sdfasdf "
5+
asdf"
6+
7+
(asdf [foo]
8+
"hel
9+
lo asd
10+
fasdfa
11+
sdf
12+
asdf
13+
as
14+
as
15+
asdf
16+
df
17+
df
18+
world")
19+
20+
#{:foo :bar
21+
:biz
22+
"ba
23+
z"}
24+
25+
#"foo
26+
bar
27+
biz"
28+
29+
test "hello
30+
world"
31+
32+
regex #"asdf
33+
bar"

0 commit comments

Comments
 (0)