File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,14 @@ clojure-mode.el:
113
113
baz)
114
114
<
115
115
116
+ *g:clojure_cljfmt_compat*
117
+
118
+ Try to be (more) compatible with `cljfmt` Clojure code formatting tool. Turns
119
+ on single space indenting for forms starting with `:keywords` , `'symbols` ,
120
+ `#'variables` and `@d ereferences` (it affects, for instance, `(:require ...)`
121
+ clause in Clojure `ns` form).
122
+
123
+
116
124
CLOJURE *ft-clojure-syntax*
117
125
118
126
*g:clojure_syntax_keywords*
Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ if exists("*searchpairpos")
51
51
let g: clojure_align_subforms = 0
52
52
endif
53
53
54
+ if ! exists (' g:clojure_cljfmt_compat' )
55
+ let g: clojure_cljfmt_compat = 0
56
+ endif
57
+
54
58
function ! s: syn_id_name ()
55
59
return synIDattr (synID (line (" ." ), col (" ." ), 0 ), " name" )
56
60
endfunction
@@ -322,9 +326,16 @@ if exists("*searchpairpos")
322
326
return [paren[0 ], paren[1 ] + (g: clojure_align_subforms ? 0 : &shiftwidth - 1 )]
323
327
elseif w [1 ] == ' _'
324
328
return paren
329
+ elseif w [1 ] == " '" && g: clojure_cljfmt_compat
330
+ return paren
325
331
endif
326
332
endif
327
333
334
+ " Paren indent for keywords, symbols and derefs
335
+ if g: clojure_cljfmt_compat && w [0 ] = ~# " [:@']"
336
+ return paren
337
+ endif
338
+
328
339
" Test words without namespace qualifiers and leading reader macro
329
340
" metacharacters.
330
341
"
You can’t perform that action at this time.
0 commit comments