Skip to content

Lingnik/shrepl.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shrepl.nvim

A Neovim plugin to execute shell commands from within Neovim and display the output inline.

Features

  • Execute the current line or visual selection in the shell.
  • Optionally reselect the command after execution for easy re-execution.
  • Optionally capture stdout and stderr separately.
  • Configurable key mappings.

Installation

Use your favorite plugin manager. For example, with Lazy.nvim:

{
  'Lingnik/shrepl.nvim',
  config = function()
    require('shrepl').setup({
      reselection_enabled = true, -- optional; default=true
      capture_stderr_separately = true, -- optional; default=true
      shrepl_shell = "zsh", -- optional; default=zsh
    })
  end,
}

Configuration

The setup function accepts a table with the following options:

  • reselection_enabled (boolean): Whether to reselect the command after execution in visual mode. Default is true. false = equivalent of hitting ESC after execution.
  • capture_stderr_separately (boolean): Whether to capture stderr separately from stdout. Default is true. false = stdout and stderr will be inline.

Usage

  • Normal Mode: Press <leader>x to execute the current line in the shell.
  • Visual Mode: Select lines and press <leader>x to execute them in the shell.

shrepl will insert the output of the command above the line/selection, allowing you to re-execute the command at your leisure, or edit it.

About

Use neovim as a simple shell REPL/notebook -- execute a shell command in a buffer, then see its stdout/stderr.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages