Put All of Your Tmux Configs and Plugins in a .config/tmux Directory
In just a few minutes you can have all of your Tmux related configs neatly tucked away outside of your root home directory.
It’s nice not to need ~/.tmux.conf
or a ~/.tmux/
directory in your home
directory.
As long as you have Tmux version 3.1+ which you can check with tmux -V
then
you can put your Tmux config in ~/.config/tmux/tmux.conf
and Tmux will use it
out of the box.
Also if TPM (Tmux Plugin Manager) finds your Tmux config there it will install
plugins into ~/.config/tmux/plugins
without any additional configuration.
Technically you can customize this default path too which is
documented.
Sticking with the theme of putting all Tmux related configuration in 1 spot,
you can configure Tmux Resurrect to save its state files to
~/.config/tmux/resurrect
by adding set -g @resurrect-dir "~/.config/tmux/resurrect"
to your tmux.conf
. I have this in my
dotfiles.
The video below goes over how to configure everything.
# Demo Video
Timestamps
- 0:29 – Config directory for tmux and TPM
- 1:22 – Getting tmux-resurrect to use this path
- 1:57 – Bonus tip on sourcing files in your tmux.conf
Is this how you have Tmux configured? Let me know below.