File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 138
138
[string & opts]
139
139
(let [{:keys [in out pre keys]} (apply hash-map opts)
140
140
test-file (str " tmp/test-indent-" (string/replace string #"[^\w -]" " -" ) " .clj" )
141
- vim-expr (format " IndentFile(%s)"
142
- (if keys
143
- (string/replace (pr-str keys) " \\\\ " " \\ " )
144
- " " ))]
141
+ vim-expr (if keys
142
+ (format " TypeKeys(%s)" (string/replace (pr-str keys) " \\\\ " " \\ " ))
143
+ " IndentFile()" )]
145
144
`(with-transform-test ~string
146
145
{:in ~in :out ~out}
147
146
[tmp#]
148
147
; ; FIXME: Too much file IO
148
+ (~io/make-parents ~test-file)
149
149
(spit ~test-file " " )
150
- (~vim-exec ~test-file (slurp tmp#) ~vim-expr :pre ~ pre)
150
+ (~vim-exec ~test-file (slurp tmp#) ~vim-expr ~@( when pre [ :pre pre]) )
151
151
(spit tmp# (slurp ~test-file)))))
152
152
153
153
(defn benchmark [n file buf & exprs]
Original file line number Diff line number Diff line change 3
3
execute ' set rtp=' . expand (' %:p:h:h:h' ) . ' ,$VIMRUNTIME'
4
4
filetype plugin indent on
5
5
syntax on
6
- set synmaxcol = 0
6
+ set synmaxcol = 0 backspace = 2
7
7
setfiletype clojure
8
8
9
9
function ! EDN (value)
@@ -20,8 +20,12 @@ function! ClojureSynIDNames()
20
20
return EDN (names)
21
21
endfunction
22
22
23
- function ! IndentFile (... )
24
- if a: 0 | execute ' normal! ' . a: 1 | endif
23
+ function ! TypeKeys (keys )
24
+ execute ' normal! ' . a: keys
25
+ write
26
+ endfunction
27
+
28
+ function ! IndentFile ()
25
29
normal ! gg= G
26
30
write
27
31
endfunction
You can’t perform that action at this time.
0 commit comments