How to auto resize panes in tmux?

41

20

In Vim, with

 C-W =

the windows are auto resized to the same height.

In tmux, with

 :resize-pane -U 10

I can increment the height of tmux pane in 10.

How I can auto resize the panes to the same height?

juanpablo

Posted 2012-08-02T14:41:13.017

Reputation: 5 216

Answers

65

I suggest resizing multiple panes with one of the five tmux presets:

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

M denotes the meta key, usually bound to ALT.

On Macs the meta key is usually Esc, as mentioned in the comment below.

See the tmux manpage for more information.

speakr

Posted 2012-08-02T14:41:13.017

Reputation: 3 379

1useful to remap left option key to +Esc in iterm2 for macs. Prefs -> Profiles -> Keys -> Left option key acts as... setting. – Danny – 2014-11-11T14:37:12.637

15M for 'meta', not 'magic' :) On Macs (not specified in the question, just for the benefit of any Mac users that might read this) it's usually the Escape key. – chepner – 2012-08-02T16:33:13.190

1@chepner Now you made me taking all the magic from my reply... :( – speakr – 2012-08-02T21:40:50.990

1+1 … I have a tmux compiled from source running on Linux and the default meta key is also Escape, rather than Alt. – Konrad Rudolph – 2013-02-05T09:54:10.603

36

PREFIX Space is shortcut for :next-layout

Oleg Kovalenko

Posted 2012-08-02T14:41:13.017

Reputation: 461