默认的 tmux.conf 文件在哪里?

glo*_*rdk 57 tmux

我想将默认的 tmux.conf 文件复制到我的主目录,但在 Ubuntu 12.04 中找不到该位置。手册页指出该文件位于 /etc/tmux.conf 但这与我的设置不匹配。

小智 69

您可以使用当前(默认)设置作为起点:

tmux show -g | cat > ~/.tmux.conf
Run Code Online (Sandbox Code Playgroud)

请注意,由于将 tmux 标准输出重定向到文件时存在已知错误,因此现在需要连接到 cat 的管道。

  • 或`tmux show -g | sed 's/^/set-option -g /' > ~/.tmux.conf`:这已经在所有行前面加上了`set -g` (15认同)
  • 我收到错误:/tmp/tmux-0/default 上没有运行服务器 (5认同)
  • 你不需要`cat`。只需执行`tmux show -g > ~/.tmux.conf`。像这样使用 `cat` 被称为 UUOC - “对 `cat` 的无用使用”。 (3认同)

bar*_*rak 17

根据dpkg -L tmux向您显示软件包安装了哪些文件,软件包中不包含默认的 tmux.conf。/etc/tmux.conf只是您可以使用的位置(仅对使用 tmux 的多个用户才有意义)将在 ~/.tmux.conf 之前进行评估。您必须创建自己的 .conf 文件。看看这个例子(第一次点击谷歌):

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

  • Not Found 在此服务器上找不到请求的 URL /~wired/conf/tmux.conf。dev.gentoo.org 端口 443 上的 Apache 服务器 (5认同)

Ale*_*x H 12

最重要的答案tmux show -g | cat > ~/.tmux.conf对我来说不起作用,因为我遇到了很多unknown command错误。

经过进一步挖掘,它与语法更改有关,因此tmux show -g不再生成有效的配置文件。您必须在每一行前面加上set -g以下内容才能使其正常工作或运行:

tmux show -g | sed 's/^/set -g /' > ~/.tmux.conf
Run Code Online (Sandbox Code Playgroud)


ish*_*ish 9

没有默认/etc/tmux.conf文件。您可以从 中的示例 conf 文件开始/usr/share/doc/tmux/examples,或者查看手册/web/etc。想出你自己的配置文件。

examples目录包含:

/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