Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
in .nvimrc add
" requires vim-fireplace
au TermOpen * let g:last_term_job_id = b:terminal_job_id
function! SendToTerm(lines)
call jobsend(g:last_term_job_id, add(a:lines, ''))
endfunction
function! SyncRepl()
call SendToREPL("(require '[clojure.pprint :refer [pprint]])(require '[clojure.repl :refer :all])")
call SendToTerm([" (in-ns '" . fireplace#ns() . ") "] )
endfunction
function! SendToREPL(sexp)
call fireplace#session_eval(a:sexp)
endfunction
nnoremap <silent> <Leader>fr :call SyncRepl()<CR>
----------
start nvim in a dir with a lein project
:sp
:terminal lein repl
-------------
in another buffer open a clj file
:e src/core.clj
<leader>fr
" now the lein repl has changed into the core.clj namespace instead of the user namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.