I’m a big fan of tmux since I started using it back in 2010. I can’t conceive working on a terminal window without it, and I also use it in remote systems I access via SSH.
It turns out that tmux has a great plugin ecosystem, and it even has its own plugin manager called TPM (“tmux plugin manager”, duh) to help you install and update them. So, of course, the first thing you need to do is to install it:
$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
And then add the following entries to your ~/.tmux.conf file, making sure that the initialization line is at the very bottom of the file:
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialization. Should be the last line of the .tmux.conf file!
run -b '~/.tmux/plugins/tpm/tpm'
After saving the .tmux.conf file, reload your tmux configuration (I have bound my prefix + r sequence for that), and then use the prefix + I (that’s an uppercase “I”) to download and install all your plugins locally. You can find a lot of plugins on the tmux-plugins repository.
The three plugins I’m using are the following:
- tmux-sensible providing basic tmux settings everyone can agree on.
- tmux-pain-control with standard pane key-bindings for tmux, making it easier to navigate and resize panes.
- tmux-resurrect which persists and restores tmux environment across system restarts.