How do I get a default tmux configuration file?

There should be several example configuration files in either /usr/share/doc/tmux/examples or /usr/share/tmux/. You can copy any of those over to ~/.tmux.conf to test out.

Alternatively, you could create a ~/.tmux.conf with the default settings by using this command from within tmux:

tmux show -g > ~/.tmux.conf

This command works with tmux version 1.8.

In older versions of tmux, a bug regarding redirecting stdout to a file might require this command:

tmux show -g | cat > ~/.tmux.conf

More info can be found here.


If the .tmux.conf file does not exist, then you can simply create it. tmux would read it the next time you start tmux.

The rest of this answer concerns figuring out what the "default options" are, but note that you don't really need this unless you're interested in what they are.

The tmux utility's own show-options command with the -g flag will dump all the globally set options in the current tmux session (i.e., tmux has to be running to use it).

So if you're in a tmux session, your ~/.tmux.conf file is empty, then the following will dump out the default settings:

$ tmux show-options -g >tmux.conf-default

Some options are set by tmux by inspecting the shell environment. I, for example, get status-keys vi, presumably because I use Vi key bindings in my shell (EDITOR is set to vim).

In any case, you'll get the options that way. However, I've noticed that there is very little that I ever have to configure in tmux. I find it well set up by default for my taste, and I basically just re-set the prefix key to Ctrl+a (the b key is one step too far to the right for comfort on my Dvorak keyboard), and that's that.

If you don't need/want to change anything in the default options, then you don't need a .tmux.conf file.

Tags:

Tmux