Skip to content

have a keybind in nvim for :only that also works for tmux panes

License

Notifications You must be signed in to change notification settings

karshPrime/only-tmux.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

only-tmux.nvim

Description

You probably use vim-tmux-navigator and wonder if you could further blur the line between tmux and nvim panes. With this plugin you could by extending the use of :only to minimise/close tmux panes on your current window as well.

With a keybind you'll minimise all unfocused nvim panes to buffer and either move all other tmux panes to new window or simply delete them (or just config different keys for different actions).

preview

Installation and Setup

Install using your favorite plugin manager. For example, using lazy.nvim:

{  'karshPrime/only-tmux.nvim',
    event = 'VeryLazy',
    config = { new_window_name = "session" } -- optional
},

Keybinds

-- move nvim panes to buffer and close unfocused tmux panes
vim.keymap.set('n', '<leader>o', ':TMUXonly close<CR>', { silent = true })

-- move nvim panes to buffer and move unfocused tmux panes to new window
vim.keymap.set('n', '<leader>O', ':TMUXonly move<CR>', { silent = true })

About

have a keybind in nvim for :only that also works for tmux panes

Topics

Resources

License

Stars

Watchers

Forks

Languages