Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pappasam/nvim-repl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim REPL

Create, use, and remove interactive REPLs in Neovim 0.11.0 or later (nightly recommended).

Works with any REPL, but contains built-in support for aider, bash, ipython, node, nvim, R, sh, utop, and zsh.

Documentation

Full documentation: here. From within Neovim, type :help repl.

Installation

Neovim REPL is a normal Neovim package.

Example configuration with 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",
  opts = {
    filetype_commands = {
      javascript = {cmd = "deno repl", filetype = "javascript"},
    },
    default = {cmd = "bash", filetype = "bash"},
    open_window_default = "vertical split new",
  },
  keys = {
    { "<Leader>c", "<Plug>(ReplSendCell)",   mode = "n", desc = "ReplSendCell" },
    { "<Leader>r", "<Plug>(ReplSendLine)",   mode = "n", desc = "ReplSendLine" },
    { "<Leader>r", "<Plug>(ReplSendVisual)", mode = "x", desc = "ReplSendVisual" },
  },
}

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.

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.

My tabline is really long

Sometimes, terminal commands (like aider) can be long. If your tabline is long, you can customize it.

Click here for an example