Sunday, February 16, 2025

5 of the Best Productivity Plugins for Tmux

https://www.maketecheasier.com/best-productivity-plugins-for-tmux

Tmux is a great terminal multiplexer that can consolidate and manage different console sessions. While its core features cover most use cases, it also has a plugin framework that allows you to shape the program for your needs. In this article, I will go through some of the best plugins for Tmux that can help optimize your terminal workflow.

1. tmux-menus

If you’re new to Tmux, learning every keybind can be tricky and daunting. With its unintuitive chorded shortcuts, it’s easy to forget the keybinds to lesser-known Tmux features such as copy mode and pane marking.

A terminal showing a multi-pane Tmux setup with a marked pane and a pane in copy mode.

Tmux-menus is a simple plugin that addresses this issue. It provides a clean and intuitive TUI-based menu that you can access by pressing Ctrl + \ (Backslash). Inside, it comes with every Tmux function, allowing you to visually select what you need instead of memorizing their keyboard shortcuts.

A terminal showing the tmux-menus plugin working.

Apart from making Tmux accessible, one quality that I like about Tmux-menus is configurability. Every menu item inside the plugin is just a link to a shell script. This means that with a little Bash know-how, you can easily include custom functions to Tmux-menus.

A terminal showing the custom "on-the-fly" config menu for tmux-menus.

2. tmux-resurrect

One of the biggest pain points of Tmux is that it’s a stateless program. This means it won’t remember anything about the session when you close it. Personally, I find this frustrating as it forces me to redo my Tmux layout whenever I restart my computer.

A terminal showing the a Tmux session abruptly disconnected.

Tmux-resurrect is a tool that can help solve this problem. It’s a no-frills plugin that preserves entire Tmux environments, including window order and pane layout. It also stores incremental snapshots of your sessions, meaning you can “go back in time” and load different versions of your Tmux setup.

A terminal showing the internals of a Tmux layout.

Another feature that I like about Tmux-resurrect is that it can save the state of a running program. Granted, the implementation isn’t perfect, and the feature only covers a handful of apps. However, the plugin handles it well enough to make your Tmux setup more seamless.

A terminal showing the restore process in tmux-resurrect that includes recovering the program state.

Good to know: interested in how Tmux-resurrect does its magic? Take a deep dive on how Tmux manages windows and panes in a session.

3. tmux-notify

Keeping track of background programs can be difficult if you’re juggling multiple Tmux panes and sessions. In my experience, this led to moments where I forgot that I had a command running in the background and accidentally closed Tmux.

A terminal showing recently closed Tmux sessions.

Tmux-notify is a plugin that sends a notification when it detects a finished process. It works by checking any active Tmux pane that just transitioned to a Bash shell prompt. The plugin then sends a libnotify message, which can either be a visual terminal bell or an audible ping.

A terminal showing the libnotify toast notification for the running Tmux task.

While that notification style works for most users, Tmux-notify also offers support for Telegram bots, Pushover alerts, and custom commands. This makes it possible to integrate Tmux-notify on just about any workflow, making it an attractive option for tinkerers who want to tune their terminal setup.

On a side note: are you new to the command line? Start your journey on the right foot by checking out our beginner’s guide to using the Linux terminal.

4. tmux-jump

Buffer navigation is arguably one of the clunkiest parts of Tmux. The multiplexer provides no built-in keyboard shortcuts for movement outside of copy mode and window focus. As someone who uses Tmux for daily productivity tasks, I find this odd quirk both tedious and frustrating, especially for long terminal sessions.

Tmux-jump solves this issue by making Tmux pane navigation both easy and intuitive. Taking inspiration from Vimium, it uses keyword hints to create “jump points” inside your Tmux windows. These allow you to move quickly inside Tmux without relying on its complex shortcuts.

A terminal showing the keyword hints in Tmux-jump.

Tmux-jump shines the most when you combine it with plugins like EasyMotion for Vim. In my case, this setup creates a consistent workflow where the terminal and text editor follow the same movement keybinds. This makes them behave similar to an IDE, which is hard to replicate for full-suite programs like Emacs.

A terminal showing the keyword hints working in a multi-pane Tmux setup.

5. treemux

Treemux is a powerful plugin that seamlessly integrates Neovim’s tree-style file browser with Tmux. It can navigate folders, open files, and even display the current working directory. This makes it an invaluable plugin if you want to create a Neovim-based IDE inside Tmux.

A terminal showing the Treemux plugin working on one Tmux pane.

The developer of Treemux also designed the plugin to be as unobtrusive as possible. It doesn’t show up by default and adjusts its size according to the pane it’s attached to. As such, Treemux is an excellent plugin if you prefer a “zen-like” terminal with minimal distractions.

A terminal showing the Treemux plugin working on individual panes.

Lastly, Treemux has a couple of Neovim extensions that expand the plugin’s default feature set. Tmuxsend.vim adds support for sending the full path from Treemux to Tmux, making file references quick and easy. Meanwhile, nvim-tree-remote.nvim allows you to open files in Treemux by double-clicking it with the mouse.

At the end of the day, Tmux is just a multiplexer program and these plugins will only extend what it currently does. If you’re looking to expand on what the terminal can do for you, check out how my colleague enhanced his terminal with a handful of great apps.

Image credit: Grok via x.ai. All alterations and screenshots by Ramces Red.


No comments:

Post a Comment