Skip to content

Instantly share code, notes, and snippets.

@sentientmonkey
Last active December 13, 2015 22:19
Show Gist options
  • Save sentientmonkey/4983974 to your computer and use it in GitHub Desktop.
Save sentientmonkey/4983974 to your computer and use it in GitHub Desktop.
interactive repl with vim
" map ,r to run contents in repl
map ,r :w\|:silent !cat % > repl-command<cr>:redraw!<cr>
" map ,r in visual mode to run contents in repl
vmap ,r :w !cat > repl-command<cr>:redraw!<cr>
" map ,l to map current line in repl
map ,l :silent.w !cat > repl-command<cr>:redraw!<cr>
pipe-repl.sh "lien clj"
pipe-repl.sh irb
if [ ! -p repl-command ]; then
mkfifo repl-command
fi
tail -f repl-command | $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment