Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Put All of Your Tmux Configs and Plugins in a .config/tmux Directory

put-all-of-your-tmux-configs-and-plugins-in-a-config-tmux-directory.jpg

In just a few minutes you can have all of your Tmux related configs neatly tucked away outside of your root home directory.

Quick Jump:

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.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments