42

I want to copy the default tmux.conf file to my home directory, but I can't find the location in Ubuntu 12.04. The man page states that the file resides at /etc/tmux.conf however this does not match with my setup.

  • 4
    To find a file with name <filename> in a directory <directoryname> use the following command: find <directory> -iname <filename>. – green Sep 24 '12 at 11:32
52

You can use the current (default) settings as a starting point:

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

Note the pipe to cat is required for now because of a known bug when redirecting tmux stdout to file.

  • 8
    or tmux show -g | sed 's/^/set-option -g /' > ~/.tmux.conf: that would already prepend all the lines with a set -g – Tobias Kienzler Nov 6 '13 at 13:33
  • I got the error: no server running on /tmp/tmux-0/default – RutgerH Aug 7 '17 at 19:53
  • @RutgerH start tmux then detach session then do this command. I also saw this :D – Kangarooo Nov 7 '17 at 17:32
  • 2
    You don't need cat. Just do tmux show -g > ~/.tmux.conf. Using cat like this is known as UUOC - "useless use of cat". – shadowtalker Nov 22 '17 at 18:41
15

As per dpkg -L tmux which shows you what files the package installed, there is no default tmux.conf included in the package. /etc/tmux.conf is just a location that you may use (only makes sense with multiple users using tmux) that will be evaluated before ~/.tmux.conf. You have to create your own .conf file. Have a look at this for example (first hit on google):

http://dev.gentoo.org/~wired/conf/tmux.conf

  • 2
    Not Found The requested URL /~wired/conf/tmux.conf was not found on this server. Apache Server at dev.gentoo.org Port 443 – Kangarooo Nov 7 '17 at 17:33
7

There is no default /etc/tmux.conf file. You can start with the example conf files in /usr/share/doc/tmux/examples, or look at the manual/web/etc. to come up with your own configuration file.

The examples directory contains:

/usr/share/doc/tmux/examples/n-marriott.conf
/usr/share/doc/tmux/examples/t-williams.conf
/usr/share/doc/tmux/examples/vim-keys.conf
/usr/share/doc/tmux/examples/h-boetes.conf
/usr/share/doc/tmux/examples/screen-keys.conf
-2

The config file is located in /usr/share/tmux, not in /usr/share/doc/tmux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.