nvim-repl

nvim-repl

Better REPLs in Neovim with custom support for aider (AI), ipython, and utop

Stars: 76

Visit
 screenshot

README:

Neovim REPL

Create, use, and remove interactive REPLs within Neovim.

Works with any REPL, but contains custom support for the following REPLs:

  • aider: AI pair programming in your terminal
  • ipython: a powerful interactive Python shell
  • utop: a much improved interface to the OCaml toplevel

Default REPL implementations are defined in plugin/repl.vim(s:default_commands).

Demo

demo

Installation

Neovim REPL is a normal Neovim package.

lazy.nvim

Configuration for https://github.com/folke/lazy.nvim

Basic

{
  "pappasam/nvim-repl",
  keys = {
    { "<Leader>c", "<Plug>(ReplSendCell)",   mode = "n", desc = "Send Repl Cell" },
    { "<Leader>r", "<Plug>(ReplSendLine)",   mode = "n", desc = "Send Repl Line" },
    { "<Leader>r", "<Plug>(ReplSendVisual)", mode = "x", desc = "Send Repl Visual Selection" },
  },
}

Custom

{
  "pappasam/nvim-repl",
  init = function()
    vim.g["repl_filetype_commands"] = {
      javascript = "deno repl",
    }
  end,
  keys = {
    { "<Leader>c", "<Plug>(ReplSendCell)",   mode = "n", desc = "Send Repl Cell" },
    { "<Leader>r", "<Plug>(ReplSendLine)",   mode = "n", desc = "Send Repl Line" },
    { "<Leader>r", "<Plug>(ReplSendVisual)", mode = "x", desc = "Send Repl Visual Selection" },
  },
}

FAQ

Escape doesn't work in Terminal mode

If you find yourself in Terminal mode, use <C-\><C-n> instead of <Esc> to return to Normal mode.

Type :help Terminal-mode and :help CTRL-\_CTRL-N for more information.

Recommended aider configuration

The built-in aider integration overrides aider's --multiline, --notifications, and --notifications-command for a smooth Neovim integration. All other settings default to the user's aider configuration file and environment. To that end, we recommend:

  1. Use $AIDER_MODEL to specify your preferred model before opening Neovim.
  2. For other settings, please reference the Author's current aider configuration for inspiration.

Where's the documentation?

Documentation is in a standard Neovim documentation file. You can read it online here.

From within Neovim, type :help repl.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for nvim-repl

Similar Open Source Tools

For similar tasks

No tools available

For similar jobs

No tools available