Skip to content

js/tmux-sendit.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-sendit.nvim

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.

image image

Requirements

  • neovim >= 0.9
  • tmux

Installation

lazy.nvim

{
  "js/tmux-sendit.nvim",
  opts = {},
}

packer.nvim

use {
  "js/tmux-sendit.nvim",
  config = function()
    require("sendit").setup({})
  end,
}

mini.deps

MiniDeps.add({
  source = "js/tmux-sendit.nvim",
})
require("sendit").setup({})

Configuration

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 = " ",
})

Commands & Keybindings

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 = {},
}

Commands

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

License

MIT

About

Send selection or current filepath to another tmux pane from within neovim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages