Created
February 23, 2015 01:58
-
-
Save jgdavey/74028228e2c25bfb13fe to your computer and use it in GitHub Desktop.
browser repl vimrc workaround
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
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