Skip to content

Instantly share code, notes, and snippets.

@jgdavey
Created February 23, 2015 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgdavey/74028228e2c25bfb13fe to your computer and use it in GitHub Desktop.
Save jgdavey/74028228e2c25bfb13fe to your computer and use it in GitHub Desktop.
browser repl vimrc workaround
function! s:brepl(remove) abort
if a:remove
call fireplace#platform().piggieback("", 1)
echo "Piggieback connection removed"
else
let form = '(do ' .
\ '(require ''adzerk.boot-cljs-repl)' .
\ '(let [env (adzerk.boot-cljs-repl/repl-env)]' .
\ ' (Thread/sleep 100)' .
\ ' env))'
call fireplace#platform().piggieback(form)
call fireplace#platform().piggieback("", 1)
call fireplace#platform().piggieback(form)
echo "Piggieback connection started"
endif
return ""
endfunction
augroup vimrc
autocmd!
autocmd FileType clojure command! -buffer -bang Brepl call s:brepl(<bang>0)
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment