如何在 tmux 中自动调整窗格大小?

jua*_*blo 48 tmux

在 Vim 中,与

 C-W =
Run Code Online (Sandbox Code Playgroud)

窗户会自动调整到相同的高度。

在 tmux 中,与

 :resize-pane -U 10
Run Code Online (Sandbox Code Playgroud)

我可以将 tmux 窗格的高度增加 10。

如何将窗格自动调整到相同的高度?

spe*_*akr 77

我建议使用五个 tmux 预设之一调整多个窗格的大小:

C-b M-1             # vertical split, all panes same width
C-b M-2             # horizontal split, all panes same height
C-b M-3             # horizontal split, main pane on top,
                      other panes on bottom, vertically split, all same width
C-b M-4             # vertical split, main pane left,
                      other panes right, horizontally split, all same height
C-b M-5             # tile, new panes on bottom, same height before same width
Run Code Online (Sandbox Code Playgroud)

M表示元键,通常绑定到ALT.

在 Mac 上,元键通常是Esc,如下面评论中所述

有关更多信息,请参阅 tmux 联机帮助页。

  • M 代表“元”,而不是“魔法” :) 在 Mac 上(问题中未指定,只是为了任何可能阅读本文的 Mac 用户的利益)通常是 Escape 键。 (20认同)
  • @chepner 现在你让我从我的回复中汲取了所有的魔力...... :( (2认同)
  • 用于将左选项键重新映射到 iterm2 for mac 中的 +Esc。首选项 -> 配置文件 -> 键 -> 左选项键充当...设置。 (2认同)

小智 42

PREFIX Space 是 :next-layout 的快捷方式