Skip to content

Commit 555866e

Browse files
Add clj support
1 parent 1ed927f commit 555866e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

autoload/jack_in.vim

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,21 @@ function! jack_in#lein(...)
4343
endif
4444
call s:RunRepl(l:lein_string.' '.l:lein_task)
4545
endfunction
46+
47+
function! jack_in#clj(...)
48+
let l:clj_string = 'clj -Sdeps'
49+
let l:deps_map = '{:deps {'
50+
let l:cider_opts = '-e ''(require (quote cider-nrepl.main)) (cider-nrepl.main/init ['
51+
52+
for [dep, inj] in items(g:jack_in_injections)
53+
let l:deps_map .= dep . ' {:mvn/version "' . inj['version'] . '"} '
54+
let l:cider_opts .= ' "'.inj['middleware'].'"'
55+
endfor
56+
57+
let l:deps_map .= '}}'
58+
let l:cider_opts .= '])'''
59+
60+
let l:command = l:clj_string . ' ''' . l:deps_map . ''' ' . l:cider_opts . ' ' . join(a:000, ' ')
61+
62+
call s:RunRepl(l:command)
63+
endfunction

plugin/jack_in.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ let g:jack_in_injections =
1717

1818
command! -nargs=* Boot call jack_in#boot(<q-args>)
1919
command! -nargs=* Lein call jack_in#lein(<q-args>)
20+
command! -nargs=* Clj call jack_in#clj(<q-args>)

0 commit comments

Comments
 (0)