Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
98 views
in Technique[技术] by (71.8m points)

Tmux: Switch the split style of two adjacent panes

I realize that reshaping pane layout in general is not trivial to describe, but I'm interested in at least being able to swap the layout of two adjacent panes.

Suppose I've got these panes laid out like this

 _____________
|    |        |
|    |   2    |
|    |________|
| 0  |        |
|    |        |
|    |        |
|    |   3    |
|____|        |
| 1  |        |
|____|________|

And I now discover that I want even more vertical space with pane 3. It's clearly not trivial to consider how I could rearrange it with pane 0 or 1 but it would be really nice if I could tell 3 and 2 to flip splitting axis:

 _____________
|    |     |  |
|    |     |  |
|    |     |  |
| 0  |     |  |
|    |  3  |2 |
|    |     |  |
|    |     |  |
|____|     |  |
| 1  |     |  |
|____|_____|__|

(note here tmux will most likely reorder it so the old 3 becomes the new pane #2)

Currently when I try to run join-pane -h to reorganize it it tells me "cannot join pane to its own window". Yeah, well, I'm just trying to shuffle it without disrupting the entire layout.

I guess a workaround is to break it out to its own named window and then immediately join it back, though it looks like it won't be able to determine the orientation to switch to (horizontal vs vertical).

Note this is different from the operation of swapping the locations of two panes, for which there exists a command ready to use. I'm looking to swap the splitting axis.

question from:https://stackoverflow.com/questions/15439294/tmux-switch-the-split-style-of-two-adjacent-panes

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Prefix + Space is bound to next layout


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...