Skip to content

Neovim plugin that allows you to switch between tmux sessions, right from Neovim (After using it a bit a figured out that it isn't that usefuell)

License

Notifications You must be signed in to change notification settings

jkeresman01/tmux-switch.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-switch.nvim

Neovim plugin that allows you to switch between tmux sessions, right from Neovim, using fuzzy find functionality.

Lua Neovim 0.10 Work In Progress

Table of Contents

The problem ⚠️

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.


The solution 🏆

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.

asciicast


Repository structure 📂

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

Functionalities ⛏️

  • 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

Installation ⭐

  • Make sure you have Neovim v0.9.0 or greater. ❗
  • Dependecies: nui && telescope && plenary (telescope dep)
  • Install using you plugin manager

Vim Plug

Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'MunifTanjim/nui.nvim'

Plug 'jkeresman01/tmux-switch.nvim'

Packer

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'

Commands 🔧

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

Setup 🔧

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)

About

Neovim plugin that allows you to switch between tmux sessions, right from Neovim (After using it a bit a figured out that it isn't that usefuell)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages