tmux Plugins Guide: TPM, Resurrect, Continuum & More
Complete guide to tmux plugins. Learn how to install and configure TPM (Tmux Plugin Manager), essential plugins like resurrect, continuum, sensible, yank, and vim-navigator with best practices.
Dai Aoki
CEO at init, Inc. / CTO at US & JP startups / Creator of WebTerm
Why Use tmux Plugins?
Plugins extend tmux functionality without writing complex configurations from scratch. The tmux plugin ecosystem is mature and stable, with well-maintained plugins that solve common workflow challenges.
With plugins, you can add powerful features such as session persistence across reboots, seamless clipboard integration with your operating system, vim-style navigation between tmux panes and vim splits, and much more. Instead of spending hours crafting custom scripts, you can install a plugin and have it working in seconds.
The plugin ecosystem is centered around TPM (Tmux Plugin Manager), which provides a simple and consistent way to install, update, and remove plugins. Most popular plugins follow the same conventions, making them easy to configure and combine.
Installing TPM (Tmux Plugin Manager)
TPM is the standard plugin manager for tmux. It handles installing, updating, and removing plugins with simple key bindings. Start by cloning the TPM repository:
# Clone TPM into the tmux plugins directory
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmNext, add the following to your ~/.tmux.conf:
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize TPM (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'Reload your tmux configuration to activate TPM:
# Reload tmux.conf from within tmux
tmux source ~/.tmux.confTPM provides the following key bindings for managing plugins:
| Key Binding | Action |
|---|---|
| prefix + I | Install plugins listed in tmux.conf |
| prefix + U | Update all installed plugins |
| prefix + alt + u | Remove/uninstall plugins not on the list |
After adding a new plugin to your ~/.tmux.conf, press prefix + I to install it. TPM will clone the plugin repository and source it automatically.
tmux-sensible
tmux-sensible provides a universal set of defaults that everyone can agree on. It should be your first plugin because it eliminates the need for many common configuration tweaks.
# Add to ~/.tmux.conf
set -g @plugin 'tmux-plugins/tmux-sensible'What tmux-sensible configures for you:
| Setting | Value | Description |
|---|---|---|
| escape-time | 0 | Eliminates delay after pressing Escape (critical for vim users) |
| display-time | 4000 | Messages displayed for 4 seconds |
| status-interval | 5 | Status bar refreshes every 5 seconds |
| history-limit | 50000 | Scrollback buffer increased to 50,000 lines |
| focus-events | on | Focus events enabled for terminals that support them |
| aggressive-resize | on | Window sized to smallest client actually viewing it |
tmux-sensible is designed to be non-intrusive. It only sets options that have not already been set by the user, so your custom configuration always takes precedence. This makes it a safe and recommended starting point for any tmux setup.
tmux-resurrect
tmux-resurrect saves and restores your entire tmux environment, including sessions, windows, panes, and the processes running in them. This means you can restart your computer and get back to exactly where you left off.
# Add to ~/.tmux.conf
set -g @plugin 'tmux-plugins/tmux-resurrect'Key bindings for tmux-resurrect:
| Key Binding | Action |
|---|---|
| prefix + Ctrl+s | Save the current tmux environment |
| prefix + Ctrl+r | Restore the previously saved environment |
tmux-resurrect can also restore vim and neovim sessions, as well as pane contents. Configure these additional features in your ~/.tmux.conf:
# Restore vim sessions (requires vim-obsession plugin in vim)
set -g @resurrect-strategy-vim 'session'
# Restore neovim sessions
set -g @resurrect-strategy-nvim 'session'
# Restore pane contents
set -g @resurrect-capture-pane-contents 'on'
# Restore additional programs (space-separated list)
set -g @resurrect-processes 'ssh psql mysql'Saved environments are stored in ~/.tmux/resurrect/. Each save creates a new file, so you can also manually restore from an earlier save point if needed.
tmux-continuum
tmux-continuum works alongside tmux-resurrect to provide automatic saving and restoring of your tmux environment. Instead of manually pressing key bindings, continuum handles everything in the background.
# Add to ~/.tmux.conf (requires tmux-resurrect)
set -g @plugin 'tmux-plugins/tmux-continuum'Configure continuum behavior:
# Automatic save interval in minutes (default: 15)
set -g @continuum-save-interval '15'
# Automatic restore when tmux server starts
set -g @continuum-restore 'on'
# Show continuum status in tmux status bar
set -g status-right 'Continuum: #{continuum_status}'With both resurrect and continuum configured, your tmux environment becomes virtually indestructible. Sessions are saved every 15 minutes automatically, and when you start tmux, your last saved environment is restored without any manual intervention.
Tip: Disable auto-save temporarily
Set set -g @continuum-save-interval '0' to disable automatic saving. This can be useful during debugging or when testing new configurations.
tmux-yank
tmux-yank enables copying to the system clipboard from tmux copy mode. It eliminates the need for manual clipboard configuration and works across different platforms automatically.
# Add to ~/.tmux.conf
set -g @plugin 'tmux-plugins/tmux-yank'tmux-yank automatically detects and uses the appropriate clipboard tool for your platform:
| Platform | Clipboard Tool |
|---|---|
| macOS | pbcopy |
| Linux (X11) | xclip / xsel |
| Linux (Wayland) | wl-copy |
| Windows (WSL) | clip.exe |
Key bindings in copy mode:
| Key | Action |
|---|---|
| y | Copy selection to system clipboard |
| Y | Copy selection and paste it to the command line |
With tmux-yank installed, you no longer need to manually configure clipboard integration for each platform. Enter copy mode with prefix + [, select text, and press y to copy it to your system clipboard.
vim-tmux-navigator
vim-tmux-navigator provides seamless navigation between tmux panes and vim splits using the same key bindings. This is a must-have plugin for vim users who work with tmux panes.
# Add to ~/.tmux.conf
set -g @plugin 'christoomey/vim-tmux-navigator'Navigation key bindings (work in both tmux and vim):
| Key Binding | Direction |
|---|---|
| Ctrl + h | Move to the left pane/split |
| Ctrl + j | Move to the pane/split below |
| Ctrl + k | Move to the pane/split above |
| Ctrl + l | Move to the right pane/split |
| Ctrl + \ | Move to the previous pane/split |
For this to work, you also need to install the matching vim plugin. Add it to your vim configuration:
" Using vim-plug
Plug 'christoomey/vim-tmux-navigator'
" Using lazy.nvim (Neovim)
{ "christoomey/vim-tmux-navigator" }Once both the tmux plugin and vim plugin are installed, you can navigate seamlessly between vim splits and tmux panes using Ctrl+h/j/k/l. The navigation is context-aware: if you are at the edge of a vim split, it moves to the adjacent tmux pane, and vice versa.
Other Notable Plugins
Beyond the essential plugins covered above, the tmux ecosystem offers many other useful plugins worth considering:
| Plugin | Description |
|---|---|
| tmux-plugins/tmux-open | Open highlighted file or URL from copy mode. Press o to open a file, Ctrl+o to open with $EDITOR. |
| tmux-plugins/tmux-copycat | Enhanced search with regex support and predefined searches for URLs, file paths, IPs, git hashes, and more. |
| sainnhe/tmux-fzf | Fuzzy finder integration for managing tmux sessions, windows, panes, and commands using fzf. |
| tmux-plugins/tmux-battery | Display battery percentage and status icon in the tmux status bar. Useful for laptop users. |
| tmux-plugins/tmux-cpu | Show CPU and GPU usage in the tmux status bar. Helpful for monitoring system resources. |
| dracula/tmux | Popular dark theme with battery, CPU, weather, and git status modules in the status bar. |
| catppuccin/tmux | Soothing pastel theme with multiple flavor options (Latte, Frappe, Macchiato, Mocha) and status bar modules. |
Install any of these by adding the corresponding set -g @plugin line to your ~/.tmux.conf and pressing prefix + I.
Complete Plugin Configuration Example
Here is a complete and recommended plugin section for your ~/.tmux.conf. This configuration includes the most essential plugins with sensible default settings:
# ======================
# Plugins
# ======================
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
# ======================
# Plugin Settings
# ======================
# tmux-resurrect: restore pane contents and vim sessions
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# tmux-continuum: auto-save and auto-restore
set -g @continuum-restore 'on'
set -g @continuum-save-interval '15'
# ======================
# Initialize TPM (keep this line at the very bottom of tmux.conf)
# ======================
run '~/.tmux/plugins/tpm/tpm'After adding this configuration, start tmux and press prefix + I to install all plugins. TPM will clone each plugin repository into ~/.tmux/plugins/ and source them automatically.
Best Practices
Follow these best practices to keep your tmux plugin setup clean and maintainable:
- 1.Keep your plugin list minimal. Only install plugins you actually use. Each plugin adds processing overhead when tmux starts. If you find yourself not using a plugin, remove it.
- 2.Pin plugin versions for stability. You can specify a tag or branch for any plugin by appending it after the plugin name:
set -g @plugin 'tmux-plugins/tmux-resurrect#v4.0.0'. This prevents unexpected breaking changes when updating. - 3.Back up your tmux.conf. Keep your configuration in a dotfiles repository. This makes it easy to set up tmux on a new machine and track changes over time.
- 4.Test new plugins in a scratch session first. Before adding a plugin to your main configuration, try it in a temporary session to make sure it does not conflict with your existing setup.
- 5.Keep TPM initialization at the very bottom. The
run '~/.tmux/plugins/tpm/tpm'line must be the last line in your tmux.conf. All plugin declarations and settings should come before it. - 6.Update plugins regularly. Press
prefix + Uperiodically to update your plugins. This ensures you get bug fixes and new features. - 7.Read plugin documentation. Most tmux plugins have detailed README files on GitHub. Check them for advanced configuration options and troubleshooting tips.
Official Documentation
For authoritative information, refer to the official documentation:
Related Articles
tmux - Terminal Multiplexer
Terminal multiplexer for session management and window splitting
tmux.conf Configuration Guide: Customize Your tmux
Complete tmux.conf configuration guide. Learn prefix key customization, key bindings, status bar styling, mouse settings, true color, performance tuning, and workflow-specific configs.
tmux Session Management: Complete Guide
Complete guide to tmux session management. Learn how to create, attach, detach, list, and organize sessions for efficient terminal workflows.
tmux Copy Mode: Copy, Paste & Clipboard Guide
Master tmux copy mode for copying text, searching, and clipboard integration. Covers vi and emacs modes, system clipboard setup for macOS and Linux, and buffer management.