馃珯 jamjar.nvim#
a tiny scratch terminal for Neovim
jamjar gives you a persistent, toggleable scratch terminal ~pop it open, run something, close it.
requirements#
- Neovim
>= 0.12
installation#
install with vim.pack:
vim.pack.add({ { src = "https://codeberg.org/comfysage/jamjar.nvim" } })
usage#
jamjar.make returns a toggle function for a persistent scratch terminal:
local toggle = require("jamjar").make("main")
vim.keymap.set({ "n", "t" }, "<c-space>j", toggle, { desc = "toggle scratch terminal" })
use the cmd option to run a specific command in the terminal:
local lazygit = require("jamjar").make("git", { cmd = "lazygit" })
local tests = require("jamjar").make("tests", { cmd = { "cargo", "test" } })
vim.keymap.set({ "n", "t" }, "<c-space>g", lazygit, { desc = "toggle lazygit" })
vim.keymap.set({ "n", "t" }, "<c-space>t", tests, { desc = "toggle tests" })