pickleterm.nvim is a lightweight Neovim plugin that lets you open, reuse, and send commands to named terminal buffers — so you can keep multiple interactive shells “pickled” for later use.
Stop spawning new terminals every time — reuse them intelligently.
- 🧠 Open terminal buffers by name and automatically reuse them
- 🚀 Send commands directly to existing terminal sessions
- 🔁 Keeps terminals persistent between commands
- ⚙️ Minimal Lua implementation — no dependencies
Using lazy.nvim
{
"grimmjulian/pickleterm.nvim",
}Using packer.nvim
use {
"grimmjulian/pickleterm.nvim",
config = function()
require("pickleterm").setup()
end
}require("pickleterm").setup({R = {startcmd = "R"}})
require("pickleterm").open("R")
-- or both steps in one go for setting up a single terminal:
-- require("pickleterm").open("R", "R")- Opens a terminal named
term://R - If it doesn’t exist, runs the start command
R
require("pickleterm").send_cmd("R", "summary(cars)")- Sends the command to the
term://Rbuffer - Appends a newline automatically (simulating
<Enter>)
- Open a terminal for your R REPL:
:lua require("pickleterm").open("R_Terminal", "R")
- Open another for running tests:
:lua require("pickleterm").open("Test_Terminal", "pytest")
- Send commands without leaving Neovim:
:lua require("pickleterm").send_cmd("R_Terminal", "plot(1:10)")
| Function | Description |
|---|---|
open(name, start_cmd) |
Open or reuse a terminal by name, optionally running a startup command. |
send_cmd(name, cmd) |
Send a command string to a named terminal. |
- Idle detection
- Different options for opening the buffer
Pull requests and ideas are welcome!
Open an issue or PR on GitHub.
MIT © 2025 [Julian Grimm]