nvim-repl icon indicating copy to clipboard operation
nvim-repl copied to clipboard

nvim-repl

This is a fork of vimcmdline and https://gitlab.com/HiPhish/repl.nvim

It's not usable yet. The plan is to create a simplified/minimal REPL plugin using ideas/code from the two.

Usage

  • :Repl to start the REPL.
  • yx{motion} to send text object to the REPL.
  • yxx to send the current line to the REPL.
  • {Visual}<Enter> to send the selection to the REPL.
  • !q to quit the REPL.

Configuration

nmap <Plug>(repl_start) ?
nmap <Plug>(repl_send) ?
nmap <Plug>(repl_quit) ?

let cmdline_vsplit             = 1      " Split the window vertically
let cmdline_term_height        = 15     " Initial height of REPL window or pane
let cmdline_term_width         = 80     " Initial width of REPL window or pane

You can define what application will be run as REPL for each supported file type. Create a dictionary g:repl with filetype:{dict} key-value pairs.

let g:repl {
  \ 'python': { 'bin': 'ptipython3' },
  \ 'ruby': { 'bin': 'pry' },
  \ 'sh': { 'bin': 'bash' }
  \ }

Related