Extending tmux with Plugins

So far, we’ve made modifications directly to the tmux configuration file. While that works, it can be a little awkward when doing something more complex. Bruno Sutic developed a solution to this called TPM, the tmux plugin manager. Since then, more and more people have come together to build plugins to extend tmux. Let’s use TPM to install the incredibly useful tmux-resurrect[16] plugin, which can restore tmux sessions even after a reboot!

To set it up, first clone the repository into a folder called ~/.tmux/plugins/tpm:

 $ ​​git​​ ​​clone​​ ​​https://github.com/tmux-plugins/tpm​​ ​​~/.tmux/plugins/tpm

Then add these lines to your .tmux.conf file:

 set -g @plugin ​'tmux-plugins/tpm'
 set ...

Get tmux 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.