Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking for a behavior that is similar to how vim(1) handles its split windows with ^w =. I know tmux(1) has predefined layouts with ^b Meta[1-5], but this likely does not have the layout that I am currently using.

When splitting a window, it halves the current window for both panes. Split again, and it halves that pane into two new. Combine vertical and horizontal splits, and they continue to halve each other, each new pane getting smaller and smaller.

How can I keep the new layout I've just created, but have all vertical and horizontal splits equally balanced, like vim(1) does with ^w =?

share|improve this question
    
The description for the "tiled" layout says "Panes are spread out as evenly as possible over the window in both rows and columns." Could you explain how what you want is different from this please? –  Lars Kotthoff Feb 29 '12 at 18:56
    
Sure. This describes it very well: gist.github.com/1942422 –  Aaron Toponce Mar 2 '12 at 19:39

3 Answers 3

Vertically

select-layout even-vertical
Usually assigned to: C-b M-2

Horizontally

select-layout even-horizontal
Usually assigned to: C-b M-1

share|improve this answer
    
This information was exactly what I needed for what I had been searching for. Thank you. –  asfallows Jun 26 '13 at 2:14
1  
For other people who are wondering: C-b M-2 means Control-b, and M-2 means alt+2. –  Christophe De Troyer Jun 21 at 20:49

You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.

share|improve this answer
    
Thanks, helped me, too. +1 –  0xC0000022L Jan 21 '13 at 16:05

I don't know one key shortcut, but maybe this helps you:

You can try to write some script to do the layout, and bind a key to the script. You can do this by using tmuxcommand pipe-pane [-o] [-t target-pane] [shell-command] to write the current layout to the script. Next you need to read a layout prepared by the script using tmuxcommand select-layout .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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