Guide · Plugins
tmux plugin manager (TPM): install TPM and the best tmux plugins
TPM (Tmux Plugin Manager) installs tmux plugins from one set -g @plugin '…' line each in ~/.tmux.conf. Clone it to ~/.tmux/plugins/tpm, add run '~/.tmux/plugins/tpm/tpm' as the last line of your config, then press Ctrl+b I to install, Ctrl+b U to update and Ctrl+b Alt+u to remove plugins.
On this page
- How to install TPM (tmux plugin manager)
- TPM key bindings and commands: install, update, remove
- How TPM works
- Install a tmux plugin without TPM
- How to uninstall a plugin or TPM
- TPM not working? The common causes
- The best tmux plugins (and what each one is for)
- tmux themes as plugins: Catppuccin, Dracula, Rosé Pine, Nord, Gruvbox
- tmux sensible: what the tmux-sensible plugin sets, and what tmux 3.8 already does
- Restore tmux sessions after a reboot: resurrect + continuum
- Tools that work with tmux but are not plugins
- Complete ~/.tmux.conf with plugins (tmux 3.8)
- How to write your own tmux plugin
- FAQ
- Next steps
Quick answer
How do I install TPM and my first plugin?
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
printf "%s\n" "set -g @plugin 'tmux-plugins/tpm'" "set -g @plugin 'tmux-plugins/tmux-resurrect'" "run '~/.tmux/plugins/tpm/tpm'" >> ~/.tmux.conf
tmux source ~/.tmux.confThen, inside tmux, press Ctrl+b I (capital i). TPM clones each plugin and shows TMUX environment reloaded. Done, press ESCAPE to continue. Tested with TPM's current master on tmux 3.8 and 3.4.
How to install TPM (tmux plugin manager)
TPM needs tmux 1.9 or newer, git and bash. It is a git repository that lives next to the plugins it manages, so installing it takes three steps.
Clone TPM
shellgit clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpmIf your config lives in
~/.config/tmux/tmux.conf, clone to~/.config/tmux/plugins/tpminstead: TPM installs plugins under~/.config/tmux/plugins/whenever that file exists.Declare plugins and load TPM at the bottom of ~/.tmux.conf
~/.tmux.conf# List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' # Other forms TPM accepts: # set -g @plugin 'github_username/plugin_name' # set -g @plugin 'github_username/plugin_name#branch-or-tag' # set -g @plugin 'git@github.com:user/plugin' # Keep this line at the very bottom of the file run '~/.tmux/plugins/tpm/tpm'The
runline must come last: plugins read options such as@continuum-restorewhen TPM loads them, so anything set after it is ignored until the next reload.Reload the config and install
shelltmux source ~/.tmux.conf # then, inside tmux: # prefix + I install new plugins (capital i) # prefix + U update plugins # prefix + Alt+u remove plugins no longer listedNot inside tmux yet? Just start it: the server reads the config when it starts. More on reloading the config →
TPM key bindings and commands: install, update, remove
| Task | Inside tmux | From a shell or script |
|---|---|---|
| Install plugins listed in the config | Ctrl+b I | ~/.tmux/plugins/tpm/bin/install_plugins |
| Update all plugins | Ctrl+b U, then type all | ~/.tmux/plugins/tpm/bin/update_plugins all |
| Update one plugin | Ctrl+b U, then its name | ~/.tmux/plugins/tpm/bin/update_plugins tmux-yank |
| Remove plugins you deleted from the list | Ctrl+b Alt+u (Alt+u) | ~/.tmux/plugins/tpm/bin/clean_plugins |
| Reload plugins after editing options | Ctrl+b : source ~/.tmux.conf | tmux source ~/.tmux.conf |
The bin/ scripts work without a running tmux server, which makes them the way to set up a new machine from your dotfiles. To change the keys, set @tpm-install, @tpm-update or @tpm-clean before the run line, for example set -g @tpm-update 'C-u'.
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'That snippet comes from TPM's own docs. It clones TPM the first time tmux starts on a machine that does not have it.
How TPM works
There is no magic in TPM, and knowing the three steps makes most problems obvious. TPM is a few bash scripts. It reads the @plugin lines from your config, clones each repository into the plugins folder, and runs every executable *.tmux file at the top of each plugin folder. Those files are shell scripts that call ordinary tmux commands such as bind-key and set-option.
- Where plugins go:
~/.tmux/plugins/<name>/, or~/.config/tmux/plugins/<name>/if~/.config/tmux/tmux.confexists. Override it withset-environment -g TMUX_PLUGIN_MANAGER_PATH '/some/path/'and change therunline to match. - Folder names come from the last part of the repository name.
catppuccin/tmux,dracula/tmux,rose-pine/tmuxandnordtheme/tmuxall land in a folder calledtmux, so two of them overwrite each other. Use one theme at a time. - The
@pluginline must look standard. TPM matches lines that start withset -g @pluginorset-option -g @plugin. Lines insideif-shellblocks or written asset -gqare not seen. - Plugins load every time the config loads. TPM reruns each
*.tmuxfile on everysource-file, which is why plugin settings apply after a reload but take effect in the order the plugins are listed.
Install a tmux plugin without TPM
A plugin does not need TPM. Clone it anywhere and run its .tmux file from your config:
git clone https://github.com/tmux-plugins/tmux-resurrect ~/src/tmux-resurrect
echo "run-shell ~/src/tmux-resurrect/resurrect.tmux" >> ~/.tmux.conf
tmux source ~/.tmux.confUpdate it with git -C ~/src/tmux-resurrect pull. This is also how Nix and dotfile managers install plugins, and it avoids TPM's folder-name clashes. tpack is a newer drop-in replacement for TPM written in Go, with a terminal UI: it reads the same @plugin lines, but its interface key Ctrl+b T replaces tmux 3.8's default "set pane title" binding.
How to uninstall a plugin or TPM
Remove one plugin
Delete or comment out its
set -g @pluginline, reload, and press Ctrl+b Alt+u. TPM deletes every plugin folder that is no longer listed. Key bindings the plugin made stay until the tmux server restarts (tmux kill-server), because removing files does not unbind keys.Remove TPM completely
Delete the
run '~/.tmux/plugins/tpm/tpm'line and every@pluginline, then remove the folder withrm -rf ~/.tmux/plugins(or~/.config/tmux/plugins). Restart tmux to drop the bindings.
TPM not working? The common causes
| Symptom | Cause and fix |
|---|---|
| Ctrl+b I does nothing | TPM never loaded. The run line is missing, not last, or points to the wrong folder. Run tmux list-keys | grep tpm; no output means TPM is not loaded. |
'~/.tmux/plugins/tpm/tpm' returned 127 | tmux runs run-shell with a minimal PATH, so a Homebrew bash or git is not found. Add set-environment -g PATH "/opt/homebrew/bin:/usr/local/bin:/bin:/usr/bin" above the run line. |
returned 2 on Windows or Cygwin | Windows line endings from git config core.autocrlf true. Convert the files under ~/.tmux with dos2unix and clone again. |
Plugins not found when started with tmux -f file | TPM parses only the default config files. List plugins in one option instead: set -g @tpm_plugins 'tmux-plugins/tpm tmux-plugins/tmux-sensible'. |
| Plugins installed to the "wrong" folder | You have ~/.config/tmux/tmux.conf, so TPM uses ~/.config/tmux/plugins/. Keep the clone and the run path in the same tree. |
| A theme or status bar plugin breaks another | Two plugins with the same folder name (tmux), or a theme that overwrites status-right after tmux-continuum. List themes first and continuum last. |
Error! tmux-yank dependencies not installed! | tmux-yank found no clipboard program. Install xsel, xclip or wl-clipboard (macOS and WSL already have one). We saw this message on a server with none installed. |
The best tmux plugins (and what each one is for)
These are the plugins people actually install, with the stars on GitHub and the date of the last commit, both checked on 28 October 2026. Several of the classic tmux-plugins/* plugins have not changed in years. They still work on tmux 3.8, because they only use long-stable tmux commands, but some of what they do is now built into tmux.
Source: github.com repository pages, 2026-10-28
Show the data
| Plugin | What it does | Default keys | Last commit |
|---|---|---|---|
| tmux-resurrect | Save and restore sessions, windows, panes and layouts by hand. sessions | Ctrl+b Ctrl+s save, Ctrl+b Ctrl+r restore | Mar 2023 |
| tmux-continuum | Auto-save every 15 minutes, auto-restore on server start, start tmux at boot. sessions | none | Jan 2024 |
| tmux-sensible | A handful of option and key defaults. defaults | Ctrl+b R reload, Ctrl+b Ctrl+n, Ctrl+b Ctrl+p | Aug 2022 |
| tmux-yank | Copy to the system clipboard with xsel, xclip, wl-copy, pbcopy or clip.exe. clipboard | y in copy mode, Ctrl+b y, Ctrl+b Y | Jul 2023 |
| tmux-fingers | Hint labels on URLs, paths, hashes and IPs; one key copies. clipboard | Ctrl+b F | Jun 2026 |
| tmux-open | Open the selection as a file or URL, or search it on the web. copy mode | o, Ctrl+o, Shift+s in copy mode | Aug 2022 |
| tmux-fzf | fzf menus for sessions, windows, panes, commands and key bindings. session picker fzf | Ctrl+b F | Oct 2026 |
| tmux-sessionx | Session manager pop-up with preview, fzf and zoxide. session picker fzf | Ctrl+b O | Oct 2026 |
| sesh | Go program (not a plugin) that lists sessions, zoxide dirs and configs for fzf. session picker | you bind it | Oct 2026 |
| vim-tmux-navigator | Same Ctrl+h/j/k/l moves across Vim splits and tmux panes. vim | Ctrl+h j k l (no prefix) | Jan 2026 |
| tmux-which-key | A menu of actions, like which-key in Neovim and Emacs. menus | Ctrl+b Space | May 2026 |
| tmux-floax | Toggle a floating scratch terminal (a popup). floating | Ctrl+b p, Ctrl+b P | Feb 2026 |
| tmux-pain-control | Vim-style pane keys: move, resize, split in the current directory. panes | Ctrl+b h … Ctrl+b | Ctrl+b - | Aug 2021 |
| catppuccin/tmux | Pastel theme with status modules; flavors latte, frappe, macchiato, mocha. theme | none | Oct 2026 |
| dracula/tmux | Dracula theme with CPU, RAM, battery and other widgets. theme | none | Oct 2026 |
| rose-pine/tmux | Rosé Pine theme (main, moon, dawn). theme | none | Sep 2026 |
| nordtheme/tmux | Nord color theme. theme | none | May 2023 |
| egel/tmux-gruvbox | Gruvbox theme, dark or light. theme | none | May 2025 |
Last commit: newest commit on the default branch of each repository, from a fresh clone on 28 October 2026.
tmux-resurrect: save and restore sessions
Saves every session, window, pane, working directory and layout to a text file, and restores them after a reboot. It restores a short list of programs (vi vim nvim emacs man less more tail top htop irssi weechat mutt); it cannot restore the state inside a running program. Full setup is in the resurrect and continuum section below.
set -g @plugin 'tmux-plugins/tmux-resurrect'
# prefix + Ctrl-s save prefix + Ctrl-r restoretmux-continuum: automatic save and restore
Runs resurrect's save every 15 minutes in the background and, with @continuum-restore 'on', restores the last save when the tmux server starts. It needs tmux-resurrect and a visible status line, because it hooks into status-right.
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum' # list it after any theme
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10' # minutes; 0 turns saving offtmux-sensible: shared defaults
One line, and a few defaults change. On tmux 3.8 about half of what it sets is still useful; the full list is in the tmux-sensible section.
set -g @plugin 'tmux-plugins/tmux-sensible'tmux-yank: copy to the system clipboard
Picks a clipboard program for your OS (pbcopy on macOS, xsel, xclip or wl-copy on Linux, clip.exe on WSL) and binds y in copy mode to copy the selection to it. Y copies and pastes to the command line, Ctrl+b y copies the current command line and Ctrl+b Y the pane's working directory. If your terminal supports OSC 52, tmux 3.8 can do this without a plugin, including over SSH: see tmux and the system clipboard.
set -g @plugin 'tmux-plugins/tmux-yank'tmux-fingers: copy with hints
Ctrl+b F labels every URL, path, git hash, IP address and number on screen with a letter; press the letter to copy it, Ctrl+letter to open it, Shift+letter to paste it. Needs tmux 3.0 or newer; the first Ctrl+b I runs a setup wizard that downloads or builds its binary.
set -g @plugin 'Morantron/tmux-fingers'tmux-open: open a file or URL from copy mode
Select text in copy mode and press o to open it with the default program (a URL in the browser, a file in its app), Ctrl+o to open it in $EDITOR, or Shift+s to search for it on the web.
set -g @plugin 'tmux-plugins/tmux-open'tmux-fzf: fuzzy menus for everything
Ctrl+b F opens an fzf menu to switch, kill or rename sessions, windows and panes, run any tmux command or search key bindings. It needs fzf on the PATH that tmux sees; check with tmux run-shell -b 'command -v fzf'.
set -g @plugin 'sainnhe/tmux-fzf'
TMUX_FZF_LAUNCH_KEY="C-f" # optional: prefix + Ctrl-f instead of prefix + FSession pickers: tmux-sessionx and sesh
tmux-sessionx is a plugin: Ctrl+b O opens a pop-up with your sessions, a live preview and fuzzy search, and can create sessions from directories (with zoxide). sesh is a standalone Go program (brew install sesh) that lists tmux sessions, zoxide directories and configured projects; you bind a key that pipes it into fzf. Before installing either, try tmux 3.8's built-in fuzzy switchers: Ctrl+b Tab for windows and Ctrl+b Shift+Tab for sessions.
set -g @plugin 'omerxx/tmux-sessionx'
# sesh is not a plugin; bind it yourself (needs fzf):
bind-key "T" run-shell "sesh connect \"$(sesh list | fzf-tmux -p 80%,70%)\""vim-tmux-navigator: one set of keys for Vim and tmux
Binds Ctrl+h/j/k/l without the prefix: tmux checks whether the pane runs Vim, Neovim or fzf and either passes the key on or moves to the next pane. Install the matching Vim or Neovim plugin too. It takes over Ctrl+l (clear screen), so add bind C-l send-keys 'C-l' to keep it on Ctrl+b Ctrl+l. The Neovim and tmux guide covers the editor side →
set -g @plugin 'christoomey/vim-tmux-navigator'tmux-which-key: a menu of every action
Ctrl+b Space opens a nested tmux menu of common actions, defined in a YAML file, so you do not have to remember every binding. It needs tmux 3.0 or newer (Python 3.8 is optional, for rebuilding the menu from YAML). It replaces the default Ctrl+b Space (next layout).
set -g @plugin 'alexwforsythe/tmux-which-key'tmux-floax: a floating scratch terminal
Ctrl+b p toggles a floating terminal (a display-popup attached to a session called scratch) and Ctrl+b P opens its menu to resize or embed it. It needs tmux 3.3+. tmux 3.7 and 3.8 have real floating panes built in, which you can move, resize and tile: Ctrl+b * opens one. Floating panes guide →
set -g @plugin 'omerxx/tmux-floax'
set -g @floax-bind '-n M-p' # optional: Alt+p, keeps prefix p as previous-windowtmux-pain-control: Vim-style pane keys
Ctrl+b h/j/k/l select panes, Ctrl+b H/J/K/L resize them, Ctrl+b | and Ctrl+b - split in the current directory. It replaces Ctrl+b l (last window), Ctrl+b L (last session) and the Ctrl+b < and Ctrl+b > menus, which become swap-window keys. Four lines in your own config do the same: splitting and moving panes.
set -g @plugin 'tmux-plugins/tmux-pain-control'tmux themes as plugins: Catppuccin, Dracula, Rosé Pine, Nord, Gruvbox
Since 3.8, tmux has its own light and dark themes that follow your terminal (set -g theme detect, the default); see built-in themes. Theme plugins replace the whole status line instead. Install one at a time: they share the folder name tmux under TPM, and each one rewrites status-left and status-right.
Catppuccin
The project recommends a manual clone because of TPM's folder-name clash, and pins a release tag (2.3.2 at the time of writing). Options go before the run line; the status modules go after it.
mkdir -p ~/.config/tmux/plugins/catppuccin
git clone -b v2.3.2 https://github.com/catppuccin/tmux.git ~/.config/tmux/plugins/catppuccin/tmuxset -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
set -g status-right "#{E:@catppuccin_status_application}#{E:@catppuccin_status_session}"set -g @plugin 'catppuccin/tmux#v2.3.2'
set -g @catppuccin_flavor 'mocha'
run '~/.tmux/plugins/tpm/tpm'On tmux 3.6 and newer you can switch flavors with the client-light-theme and client-dark-theme hooks; the Catppuccin README has the snippet.
Dracula
set -g @plugin 'dracula/tmux'
set -g @dracula-show-powerline true
set -g @dracula-plugins "cpu-usage ram-usage battery"Rosé Pine, Nord and Gruvbox
set -g @plugin 'rose-pine/tmux' # set -g @rose_pine_variant 'main' (main, moon, dawn)
# set -g @plugin 'nordtheme/tmux'
# set -g @plugin 'egel/tmux-gruvbox' # set -g @tmux-gruvbox 'dark' (dark, dark256, light, light256)Oh my tmux! (a config framework, not a plugin)
Oh my tmux! (gpakosz/.tmux) is a complete, ready-made ~/.tmux.conf with a powerline status bar, and you customize it in ~/.tmux.conf.local. It is not installed through TPM, though it can manage TPM plugins for you if you list them in the local file. Install, customize and update Oh my tmux →
tmux sensible: what the tmux-sensible plugin sets, and what tmux 3.8 already does
tmux-sensible (tmux-plugins/tmux-sensible) is a single bash script that changes a few options and adds four key bindings. Most option changes only happen if the option still has its old default value, so on a current tmux some of them do nothing. We ran the script (last changed in August 2022) against fresh tmux 3.8 and 3.4 servers and compared every value before and after:
| Setting | tmux-sensible sets | tmux 3.8 default | Result on 3.8 | Result on 3.4 |
|---|---|---|---|---|
escape-time | 0, only if it is still 500 | 10 | No change | 500 → 0 |
history-limit | 50000, if 2000 | 2000 | 2000 → 50000 | 2000 → 50000 |
display-time | 4000 ms, if 750 | 750 | 750 → 4000 | 750 → 4000 |
status-interval | 5 s, if 15 | 15 | 15 → 5 | 15 → 5 |
focus-events | on | off | off → on | off → on |
aggressive-resize | on (not in iTerm2) | off | off → on | off → on |
status-keys | emacs, always | emacs, or vi if $EDITOR/$VISUAL contains "vi" | Forces emacs keys at the : prompt even for Vim users | Same |
default-terminal | screen-256color, only if it is screen | tmux-256color | No change | No change |
default-command | reattach-to-user-namespace -l $SHELL, only on macOS with that tool installed | empty | No change on Linux | No change on Linux |
| Ctrl+b Ctrl+p / Ctrl+b Ctrl+n | previous / next window | unbound | Added | Added |
| Ctrl+b R | reload the config and show "Sourced …" | unbound | Added | Added |
| Ctrl+b b | last-window (the letter of your prefix: Ctrl+b a with Ctrl+a) | unbound | Added | Added |
| Custom prefix | unbinds C-b and binds prefix prefix to send-prefix | — | Only if your prefix is not C-b | Same |
Bindings are only added if the key is free, so your own bind R … wins. Is it still worth it? On tmux 3.5 and newer the famous Escape-delay fix is already the default, and the terminal setting is a no-op. If you want the rest, these six lines do the same without a plugin:
set -g history-limit 50000
set -g display-time 4000
set -g status-interval 5
set -g focus-events on
setw -g aggressive-resize on
bind R source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"aggressive-resize resizes a window to the smallest client that is looking at that window rather than at the session, which helps when several clients view different windows. focus-events lets Vim and Neovim see focus changes (for autoread).
Restore tmux sessions after a reboot: resurrect + continuum
Quick answer
How do I keep my tmux sessions after a restart?
Install both plugins, turn on automatic restore, reload and press Ctrl+b I. Save once by hand with Ctrl+b Ctrl+s; after that continuum saves every 15 minutes and restores the last save when the tmux server starts.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-capture-pane-contents 'on' # also save visible pane text
set -g @resurrect-strategy-nvim 'session' # reopen Neovim with :mksession files
set -g @continuum-restore 'on'
run '~/.tmux/plugins/tpm/tpm'| What | Detail |
|---|---|
| Save / restore by hand | Ctrl+b Ctrl+s / Ctrl+b Ctrl+r |
| Where saves go | ~/.local/share/tmux/resurrect/ (or ~/.tmux/resurrect/ if that folder already exists). last is a symlink to the newest file; point it at an older one to restore an earlier state. |
| Programs restored | vi vim nvim emacs man less more tail top htop irssi weechat mutt by default. Add others: set -g @resurrect-processes 'ssh psql "~npm run dev"'. |
| Start tmux at boot | set -g @continuum-boot 'on': a systemd user unit on Linux (starts the server only), a login item that opens Terminal.app, iTerm2, kitty or Alacritty on macOS. |
| Stop auto-restore once | touch ~/tmux_no_auto_restore |
| Show save status | #{continuum_status} in status-right shows the interval, or off. |
Saving and restoring layouts is all these plugins do. Running programs lose their state, and a restore starts fresh shells in the saved directories. For building the same workspace every time instead, see save and restore options and tmuxinator below.
Tools that work with tmux but are not plugins
tmuxinator and tmuxp
Define a project's windows, panes and start commands in YAML and launch it with one command: tmuxinator start project (Ruby) or tmuxp load project (Python, built on libtmux, can also "freeze" a running session). Better than resurrect when you want the same workspace every time. Scripting tmux →
sesh
A Go session manager that combines tmux sessions, zoxide directories and config entries into one list for fzf, gum or television. Install with brew install sesh or go install github.com/joshmedeski/sesh/v2@latest.
tmate
A fork of tmux for sharing a terminal over SSH. Its README says the public tmate.io servers were shut down in July 2025, so you need your own tmate server. Plain tmux with a shared socket does the job: pair programming with tmux.
tpack
A TPM-compatible plugin manager in Go with a terminal UI and a plugin browser. It reads the same @plugin lines and stores plugins in unique folders, which avoids TPM's tmux folder clash. Do not run it and TPM on the same plugin folder.
Complete ~/.tmux.conf with plugins (tmux 3.8)
A working config with the plugins most people want. tmux 3.8 already turns the mouse on and uses a 10 ms Escape delay, so those lines are gone. Copy it, start tmux, and press Ctrl+b I.
# ── General ────────────────────────────────
set -g history-limit 50000
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g focus-events on
# ── Colors: tell tmux the outer terminal has 24-bit color
set -g default-terminal "tmux-256color"
set -as terminal-features ",xterm*:RGB"
# ── Plugins (theme first, continuum last) ──
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'catppuccin/tmux#v2.3.2'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# ── Plugin options (before the run line) ───
set -g @catppuccin_flavor 'mocha'
set -g @continuum-restore 'on'
# Keep this line at the very bottom
run '~/.tmux/plugins/tpm/tpm'Want to build one with checkboxes and a live preview instead? Use the config generator.
How to write your own tmux plugin
A TPM plugin is a git repository with at least one executable *.tmux file at its top level. TPM runs that file (as a program, not as a tmux config) each time the config loads, so it can be any shell script that calls tmux. This complete example adds a key that shows a message; we installed it through TPM on tmux 3.8 from a local repository.
#!/usr/bin/env bash
# Runs each time TPM loads the config.
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
key="$(tmux show-option -gqv @hello-key)" # user option, with a default
tmux bind-key "${key:-H}" run-shell "$CURRENT_DIR/scripts/hello.sh"#!/usr/bin/env bash
tmux display-message "Hello from #{session_name}, pane #{pane_index}"set -g @plugin 'yourname/tmux-hello' # or 'file:///path/to/tmux-hello' while developing
set -g @hello-key 'M-h'
run '~/.tmux/plugins/tpm/tpm'- Read settings with
tmux show-option -gqv @your-optionand always fall back to a default. - Do not bind a key the user already uses: check
tmux list-keys -T prefix KEYfirst, as tmux-sensible does. - Test on the tmux versions people run (3.2a, 3.4, 3.5a and 3.8), and say in the README which tmux version you need.
- For more examples, read
sensible.tmux(one file) and TPM'sdocs/how_to_create_plugin.md.
FAQ
How do I install newly added plugins in tmux?
Add the set -g @plugin 'owner/repo' line above the run '~/.tmux/plugins/tpm/tpm' line, save, and press Ctrl+b I (capital i) inside tmux. TPM reloads the config, clones the new plugin into ~/.tmux/plugins/ and loads it. From a shell, run ~/.tmux/plugins/tpm/bin/install_plugins.
How can I automatically restore my tmux sessions after a system reboot?
Install tmux-resurrect and tmux-continuum with TPM and add set -g @continuum-restore 'on'. continuum saves every 15 minutes and restores the last save when the tmux server starts. Add set -g @continuum-boot 'on' to start tmux itself at boot. Programs restart fresh; only layouts, directories and a short list of programs come back.
How do I update tmux plugins?
Press Ctrl+b U and type all (or a plugin name) and press Enter, or run ~/.tmux/plugins/tpm/bin/update_plugins all. Update TPM itself the same way: it is listed as tmux-plugins/tpm.
Where does TPM install plugins?
In ~/.tmux/plugins/, or in ~/.config/tmux/plugins/ if ~/.config/tmux/tmux.conf exists. Each plugin gets a folder named after the last part of its repository name. Set TMUX_PLUGIN_MANAGER_PATH with set-environment -g to use another folder.
Is tmux-sensible still needed with tmux 3.8?
Not really. Its best-known fix (Escape delay) and its terminal fix do nothing on tmux 3.5 and newer, because the defaults already changed. It still raises history-limit to 50000, lengthens messages, refreshes the status line every 5 seconds, turns on focus-events and aggressive-resize, and adds four key bindings. The six-line replacement above does the same.
Why did installing a second theme break the first one?
TPM names each plugin folder after the last part of the repository name, and Catppuccin, Dracula, Rosé Pine and Nord are all called tmux, so they share ~/.tmux/plugins/tmux. Use one theme, or install themes by cloning them to their own folders and running their .tmux file.
Do tmux plugins work on tmux 3.8?
Yes. TPM, tmux-sensible, tmux-resurrect, tmux-continuum and tmux-yank all loaded and worked on our tmux 3.8 build, and resurrect even restores 3.8 floating panes. Plugins only run normal tmux commands, so they break only when they rely on a key or option that changed; check the plugin's issues after a tmux upgrade.
Next steps
Keep learning
Something wrong or out of date on this page? Email hello@tmux.app and we will fix it.