Skip to content

Commit bc495e4

Browse files
committed
Add doc for g:clojure_special_indent_words
Closes #6
1 parent e42d32c commit bc495e4

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

doc/clojure.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ Each candidate word is tested for special treatment in this order:
9191
3. Return true if word matches a pattern in *g:clojure_fuzzy_indent_patterns*
9292
4. Return false and indent normally otherwise
9393

94+
*g:clojure_special_indent_words*
95+
96+
Some forms in Clojure are indented so that every subform is indented only two
97+
spaces, regardless of 'lispwords'. If you have a custom construct that should
98+
be indented in this idiosyncratic fashion, you can add your symbols to the
99+
default list below.
100+
>
101+
" Default
102+
let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn'
103+
<
104+
94105
*g:clojure_align_multiline_strings*
95106

96107
When indenting multiline strings, align subsequent lines to the column

indent/clojure.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ if exists("*searchpairpos")
237237
" Now we have to reimplement lispindent. This is surprisingly easy, as
238238
" soon as one has access to syntax items.
239239
"
240-
" - Check whether we are in a special position after deftype, defrecord,
241-
" reify, proxy or letfn. These are special cases.
240+
" - Check whether we are in a special position after a word in
241+
" g:clojure_special_indent_words. These are special cases.
242242
" - Get the next keyword after the (.
243243
" - If its first character is also a (, we have another sexp and align
244244
" one column to the right of the unmatched (.

0 commit comments

Comments
 (0)