Skip to content

Instantly share code, notes, and snippets.

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, ''))
function! SyncRepl()
call SendToREPL("(require '[clojure.pprint :refer [pprint]])(require '[clojure.repl :refer :all])")
call SendToTerm([" (in-ns '" . fireplace#ns() . ") "] )
function! SendToREPL(sexp)
call fireplace#session_eval(a:sexp)
nnoremap <silent> <Leader>fr :call SyncRepl()<CR>
start nvim in a dir with a lein project
:terminal lein repl
in another buffer open a clj file
:e src/core.clj
" 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.