Send selected buffer contents, file paths, or diagnostics to another tmux pane without leaving neovim.
Select code, a file path, or diagnostics, pick a target pane, and the content is inserted as if you typed it. Useful for feeding code snippets, file references, diagnostics, or context to a CLI tool running in another pane - like sending selections to a claude code session without constantly switching between tmux panes.
- neovim >= 0.9
- tmux
{
"js/tmux-sendit.nvim",
opts = {},
}use {
"js/tmux-sendit.nvim",
config = function()
require("sendit").setup({})
end,
}MiniDeps.add({
source = "js/tmux-sendit.nvim",
})
require("sendit").setup({})These are the defaults — pass any overrides to setup():
require("sendit").setup({
-- shell command used to send text to a tmux pane
cmd = { "tmux", "send-keys", "-t" },
-- only list panes from the current tmux session in the picker
only_current_session = true,
-- prefix/suffix wrapped around selections sent to the pane
selection_prefix = "\n```",
selection_suffix = "```\n",
-- prefix/suffix wrapped around file paths sent to the pane
path_prefix = "@",
path_suffix = " ",
})No keybindings are set by default. Bind the functions you need in your config:
-- lazy.nvim example with keybindings
{
"js/tmux-sendit.nvim",
keys = {
{ "<leader>a", group = "sendit", icon = "", desc = "sendit to tmux" },
{ "<leader>as", function() require("sendit").send_selection() end, mode = "v", desc = "Send selection to tmux pane" },
{ "<leader>af", function() require("sendit").send_rel_path() end, mode = { "n", "v" }, desc = "Send relative file path to tmux pane" },
{ "<leader>aF", function() require("sendit").send_abs_path() end, mode = { "n", "v" }, desc = "Send absolute file path to tmux pane" },
{ "<leader>ad", function() require("sendit").send_diagnostic() end, mode = { "n", "v" }, desc = "Send diagnostics to tmux pane" },
},
opts = {},
}| command / key | mode | description |
|---|---|---|
:Sendit selection |
visual | send the current visual selection |
:Sendit path |
normal | send the project-relative file path |
:Sendit fullpath |
normal | send the absolute file path |
:Sendit diagnostic |
normal | send diagnostics to tmux pane |
MIT