Home

Awesome

Run repl code in the floating/popup window.

demo

markdown

Install

This plugin depend on vim-floaterm you need to install it first

using vim-plug

Plug 'voldikss/vim-floaterm'
Plug 'windwp/vim-floaterm-repl'

Usage

Key map

nnoremap <leader>uc :FloatermRepl<CR>
vnoremap <leader>uc :FloatermRepl<CR>

Press <ESC> or q to exit in floaterm window

Configuration

let g:floaterm_repl_runner= "/home/vim/test/runner.sh"
#!/usr/bin/env bash
filetype=$1
filepath=$2
shift
shift
params=$@
echo "Start $filetype $filepath"
echo "====================="
case $filetype in
 javascript | js)
    node $filepath $params
   ;;

 bash | sh)
    bash $filepath $params
   ;;

 go )
    go run $filepath $params
   ;;
 python | python3) 
    python3 $filepath $params
   ;;

 *)
   echo -n "unknown"
   ;;
esac
echo "====================="