Created
April 7, 2015 19:32
-
-
Save zamaterian/dfbafbeef178daf5c21b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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