Maintenance & Recovery
Editing the Config
The active config is a symlink. Always edit the canonical file:
# Do NOT edit:
~/.tmux.conf # this is a symlink
# Edit this instead:
~/github/common-config/tmux/tmux-config-symlink/.tmux.conf
Reload After Editing
# From inside tmux (command prompt):
Prefix :source-file ~/.tmux.conf
# From the command line:
tmux source-file ~/.tmux.conf
Verify a Setting
tmux show -g | grep <setting-name>
Adding a New Plugin
- Add the plugin to
~/.tmux.conf:set -g @plugin '<user>/<repo>' - Reload config:
tmux source-file ~/.tmux.conf - Install: Press
Ctrl+Space Iinside tmux - Restart tmux or reload to activate
Handling Binding Conflicts
- Check current bindings: Press
Prefix ? - The last binding loaded wins: defaults →
~/.tmux.conf→ TPM plugins - If a plugin overrides a custom binding, move the custom binding after the
runline
Migrating to a New Machine
Prerequisites on the new machine
sudo apt install tmux
Transfer the config
# Clone the common-config repo
git clone <repo> ~/github/common-config/
# Create the symlink
ln -sf ~/github/common-config/tmux/tmux-config-symlink/.tmux.conf ~/.tmux.conf
Install TPM and plugins
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
tmux source-file ~/.tmux.conf
# Inside tmux: press Ctrl+Space I to install all plugins
Transfer session backups
rsync -av old-server:~/.local/share/tmux/resurrect/ \
~/.local/share/tmux/resurrect/
Restore
Open tmux and press Ctrl+Space Ctrl+r.
Checking the Config Syntax
tmux source-file ~/.tmux.conf || echo "Syntax error in config"
If there's a syntax error, tmux reports the line number.