How do I equally balance tmux(1) split panes?
Clash Royale CLAN TAG#URR8PPP
up vote
167
down vote
favorite
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 =
?
tmux
add a comment |Â
up vote
167
down vote
favorite
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 =
?
tmux
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
1
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39
add a comment |Â
up vote
167
down vote
favorite
up vote
167
down vote
favorite
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 =
?
tmux
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 =
?
tmux
tmux
asked Feb 28 '12 at 20:53
Aaron Toponce
1,64021212
1,64021212
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
1
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39
add a comment |Â
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
1
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39
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
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
1
1
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
208
down vote
accepted
Vertically
select-layout even-vertical
Usually assigned to: Ctrl+b, Alt+2
Horizontally
select-layout even-horizontal
Usually assigned to: Ctrl+b, Alt+1
67
For other people who are wondering:C-b M-2
means Control-b, andM-2
means alt+2.
â Christophe De Troyer
Jun 21 '14 at 20:49
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
C-...
andM-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequence
â Jasen
Jul 17 '15 at 3:56
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
add a comment |Â
up vote
76
down vote
You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.
2
The idea behind the trick (if you want to map it to something else or adapt it):bind-key -r Space next-layout
. ThenC-b
Space
Space
Space
...
â BenC
Nov 24 '14 at 14:01
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
add a comment |Â
up vote
11
down vote
From the command line you can use
tmux select-layout tiled
to make your splits all roughly equal size. You can bind that to a key command as well.
1
Usually assigned to:C-b M-5
â minipif
Jan 17 at 3:40
add a comment |Â
up vote
7
down vote
I don't know any single 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 tmux
command 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 tmux
command select-layout
.
add a comment |Â
up vote
0
down vote
I was having a hard time finding the magic incantation to split into 4 equal quadrants, so here it is:
# Split session into FOUR EQUAL quadrants
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
208
down vote
accepted
Vertically
select-layout even-vertical
Usually assigned to: Ctrl+b, Alt+2
Horizontally
select-layout even-horizontal
Usually assigned to: Ctrl+b, Alt+1
67
For other people who are wondering:C-b M-2
means Control-b, andM-2
means alt+2.
â Christophe De Troyer
Jun 21 '14 at 20:49
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
C-...
andM-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequence
â Jasen
Jul 17 '15 at 3:56
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
add a comment |Â
up vote
208
down vote
accepted
Vertically
select-layout even-vertical
Usually assigned to: Ctrl+b, Alt+2
Horizontally
select-layout even-horizontal
Usually assigned to: Ctrl+b, Alt+1
67
For other people who are wondering:C-b M-2
means Control-b, andM-2
means alt+2.
â Christophe De Troyer
Jun 21 '14 at 20:49
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
C-...
andM-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequence
â Jasen
Jul 17 '15 at 3:56
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
add a comment |Â
up vote
208
down vote
accepted
up vote
208
down vote
accepted
Vertically
select-layout even-vertical
Usually assigned to: Ctrl+b, Alt+2
Horizontally
select-layout even-horizontal
Usually assigned to: Ctrl+b, Alt+1
Vertically
select-layout even-vertical
Usually assigned to: Ctrl+b, Alt+2
Horizontally
select-layout even-horizontal
Usually assigned to: Ctrl+b, Alt+1
edited Sep 8 at 18:51
Chris
1386
1386
answered May 2 '12 at 13:35
blackd
2,096193
2,096193
67
For other people who are wondering:C-b M-2
means Control-b, andM-2
means alt+2.
â Christophe De Troyer
Jun 21 '14 at 20:49
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
C-...
andM-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequence
â Jasen
Jul 17 '15 at 3:56
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
add a comment |Â
67
For other people who are wondering:C-b M-2
means Control-b, andM-2
means alt+2.
â Christophe De Troyer
Jun 21 '14 at 20:49
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
C-...
andM-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequence
â Jasen
Jul 17 '15 at 3:56
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
67
67
For other people who are wondering:
C-b M-2
means Control-b, and M-2
means alt+2.â Christophe De Troyer
Jun 21 '14 at 20:49
For other people who are wondering:
C-b M-2
means Control-b, and M-2
means alt+2.â Christophe De Troyer
Jun 21 '14 at 20:49
24
24
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
M-2 means ESC+2 for me on Debian using Gnome Terminal. Probably depends on setup.
â arcyqwerty
Nov 24 '14 at 5:06
7
7
C-...
and M-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequenceâ Jasen
Jul 17 '15 at 3:56
C-...
and M-...
are emacs-ims M- means "meta" which is [Alt] in combination with or [Esc] followed by the referenced key both options look the same over the wire, but there is the possibility that your GUI may be trapping the [Alt] sequenceâ Jasen
Jul 17 '15 at 3:56
2
2
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
Just to put this here in case it helps someone else, because I am constantly confused, "vertical" and "horizontal" are the direction of the spacing--that is, choosing even-vertical will create a layout where the three panes are stacked vertically, equal in height, where even-horizontal will create a layout where the three panes are side-by-side, equal in width
â A. Wilson
Mar 22 '16 at 16:20
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
How to do M-2 on macOS with a keyboard where "2" requires pressing shift (like the French keyboard)? I didn't succeed, with various combinations of alt, control, command, escape and shift + 2â¦
â Eric Lebigot
Apr 7 at 9:05
add a comment |Â
up vote
76
down vote
You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.
2
The idea behind the trick (if you want to map it to something else or adapt it):bind-key -r Space next-layout
. ThenC-b
Space
Space
Space
...
â BenC
Nov 24 '14 at 14:01
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
add a comment |Â
up vote
76
down vote
You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.
2
The idea behind the trick (if you want to map it to something else or adapt it):bind-key -r Space next-layout
. ThenC-b
Space
Space
Space
...
â BenC
Nov 24 '14 at 14:01
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
add a comment |Â
up vote
76
down vote
up vote
76
down vote
You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.
You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.
edited Feb 29 '16 at 17:24
Rafa
1014
1014
answered Mar 23 '12 at 19:14
Issac Trotts
76142
76142
2
The idea behind the trick (if you want to map it to something else or adapt it):bind-key -r Space next-layout
. ThenC-b
Space
Space
Space
...
â BenC
Nov 24 '14 at 14:01
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
add a comment |Â
2
The idea behind the trick (if you want to map it to something else or adapt it):bind-key -r Space next-layout
. ThenC-b
Space
Space
Space
...
â BenC
Nov 24 '14 at 14:01
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
2
2
The idea behind the trick (if you want to map it to something else or adapt it):
bind-key -r Space next-layout
. Then C-b
Space
Space
Space
...â BenC
Nov 24 '14 at 14:01
The idea behind the trick (if you want to map it to something else or adapt it):
bind-key -r Space next-layout
. Then C-b
Space
Space
Space
...â BenC
Nov 24 '14 at 14:01
2
2
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
Is there a way to know which layout I've selected, and how to quickly jump to it again?
â hughes
Apr 16 '15 at 21:15
add a comment |Â
up vote
11
down vote
From the command line you can use
tmux select-layout tiled
to make your splits all roughly equal size. You can bind that to a key command as well.
1
Usually assigned to:C-b M-5
â minipif
Jan 17 at 3:40
add a comment |Â
up vote
11
down vote
From the command line you can use
tmux select-layout tiled
to make your splits all roughly equal size. You can bind that to a key command as well.
1
Usually assigned to:C-b M-5
â minipif
Jan 17 at 3:40
add a comment |Â
up vote
11
down vote
up vote
11
down vote
From the command line you can use
tmux select-layout tiled
to make your splits all roughly equal size. You can bind that to a key command as well.
From the command line you can use
tmux select-layout tiled
to make your splits all roughly equal size. You can bind that to a key command as well.
answered Sep 30 '16 at 12:22
Mnebuerquo
24125
24125
1
Usually assigned to:C-b M-5
â minipif
Jan 17 at 3:40
add a comment |Â
1
Usually assigned to:C-b M-5
â minipif
Jan 17 at 3:40
1
1
Usually assigned to:
C-b M-5
â minipif
Jan 17 at 3:40
Usually assigned to:
C-b M-5
â minipif
Jan 17 at 3:40
add a comment |Â
up vote
7
down vote
I don't know any single 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 tmux
command 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 tmux
command select-layout
.
add a comment |Â
up vote
7
down vote
I don't know any single 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 tmux
command 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 tmux
command select-layout
.
add a comment |Â
up vote
7
down vote
up vote
7
down vote
I don't know any single 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 tmux
command 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 tmux
command select-layout
.
I don't know any single 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 tmux
command 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 tmux
command select-layout
.
edited Aug 11 '14 at 21:49
answered Apr 27 '12 at 10:58
digital_infinity
6451410
6451410
add a comment |Â
add a comment |Â
up vote
0
down vote
I was having a hard time finding the magic incantation to split into 4 equal quadrants, so here it is:
# Split session into FOUR EQUAL quadrants
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
add a comment |Â
up vote
0
down vote
I was having a hard time finding the magic incantation to split into 4 equal quadrants, so here it is:
# Split session into FOUR EQUAL quadrants
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I was having a hard time finding the magic incantation to split into 4 equal quadrants, so here it is:
# Split session into FOUR EQUAL quadrants
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
I was having a hard time finding the magic incantation to split into 4 equal quadrants, so here it is:
# Split session into FOUR EQUAL quadrants
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
answered Jun 26 at 21:33
Daevid Vincent
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f32986%2fhow-do-i-equally-balance-tmux1-split-panes%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Sure. This describes it very well: gist.github.com/1942422
â Aaron Toponce
Mar 2 '12 at 19:39