When you are in Neovim, switching between multiple TMUX sessions can be cumbersome, requiring you to leave your editor and manually navigate the command line. This disrupts your workflow, especially when managing numerous sessions. The constant context-switching between the terminal and Neovim slows down productivity and can be frustrating for users who need a more seamless experience.
TMUX Switch solves this problem by integrating fuzzy search within Neovim, allowing you to quickly switch between TMUX sessions without leaving your editor. By using this plugin, you can navigate and manage your TMUX sessions directly from Neovim which improves your overall productivity.
tmux-switch.nvim/
βββ LICENSE
βββ lua
β βββ tmux-switch
β βββ commands.lua # Commands exposed to Neovim
β βββ init.lua # Plugin entry point
β βββ tmux.lua # Tmux commands related logic
β βββ ui.lua # UI logic (pickers and layout)
β βββ util.lua # Utility functions
βββ README.md
- Fuzzy find trough all tmux session and navigate to selected one
- Floating UI for creating new sessions
- Floating UI for renaming current session
- Quick switch between 2 most used sessions (works when the
sort_by_recent_use
option is set to true, then just enter the:TmuxSwitch
command and select the first one)
- Make sure you have Neovim v0.9.0 or greater. β
- Dependecies: nui && telescope && plenary (telescope dep)
- can be used without telescope, when the config option
not_use_telescope
is set to true. Thenvim.ui.select
is used.
- can be used without telescope, when the config option
- Install using you plugin manager
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'jkeresman01/tmux-switch.nvim'
use {
'nvim-telescope/telescope.nvim', tag = '0.1.8',
-- or , branch = '0.1.x',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'MunifTanjim/nui.nvim'
use 'jkeresman01/tmux-switch.nvim'
Following commands have been exposed to Neovim:
Commands
:TmuxSwitch -- Lunch picker (select tmux session to switch to)
:TmuxCreateSession -- Create new session and give it a name
:TmuxRenameSession -- Rename current tmux session
Set the keybindings as you see fit, here is one example:
require('tmux-switch').setup({})
vim.keymap.set("n", "<C-f>", "<CMD>TmuxSwitch<CR>")
vim.keymap.set("n", "<leader>cs", "<CMD>TmuxCreateSession<CR>"
vim.keymap.set("n", "<leader>rs", "<CMD>TmuxRenameSession<CR>"
Keybindings | Action |
---|---|
<C-f> |
Lunch TMUX switch UI (fuzzy search trough tmux sessions) |
<leader>cs |
Lunch TMUX switch UI (create new TMUX session and name it) |
<leader>rs |
Lunch TMUX switch UI (rename current TMUX session) |