Skip to content

jsstevenson/nvim-tmux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-tmux

Neovim plugin for editing Tmux configuration and scripting files. Consists largely of features provided in vim-tmux, rewritten in Lua for easier Neovim integration and extensibility moving forward.

Features

  • Improved file detection
  • Support for :make, calling tmux source on the file in the current buffer. A Lua function to do the same with the plenary.nvim Job API is included as well.
  • Execute command under cursorline or visual select
  • Show the man page entry for the item under the cursor in a floating window

Requirements

Installation

With packer.nvim:

    use({
      "jsstevenson/nvim-tmux",
      requires = { "nvim-lua/plenary.nvim" },
      config = function()
        require("nvim_tmux").setup()
      end,
    })

Configuration

Provide a table overwriting any of the following keys to setup() -- defaults are below:

local nvim_tmux_default_configs = {
  floatwin = {
    -- Height and width of tmux man page display in floating window. Should be
    -- values between 0 and 1, reflecting the % of the buffer height/width to use
    height = 0.85,
    width = 0.85,

    -- Styling of man page floating window. Set to `nil` to enable line number,
    -- color columns, etc (see `style` under :h nvim_open_win)
    style = "minimal",

    -- Styling of man page floating window border. See `border` under
    -- :h nvim_open_win for the complete list of options.
    border = "single"
  }
}

No keymaps are provided by default, but you can put the following into an augroup or ftplugin/tmux.lua:

vim.keymap.set("n", "<leader>s", "<Plug>(tmux_source_file)", { silent = true, remap = false })
vim.keymap.set("n", "K", "<Plug>(tmux_show_man_floatwin)", { silent = true, remap = false })
vim.keymap.set("n", "g!!", "<Plug>(tmux_execute_cursorline)", { silent = true, remap = false })
vim.keymap.set("v", "g!", "<Plug>(tmux_execute_selection)", { silent = true, remap = false })

About

Tools for Tmux configuration and scripting in Neovim

Topics

Resources

License

Stars

Watchers

Forks

Languages