title: Tmux: Switch the split style of two adjacent panes
body: <p>I realize that reshaping pane layout <em>in general</em> is not trivial to describe, but I'm interested in at least being able to swap the layout of two adjacent panes. </p>
  
  <p>Suppose I've got these panes laid out like this</p>
  
  <pre><code> _____________
  |    |        |
  |    |   2    |
  |    |________|
  | 0  |        |
  |    |        |
  |    |        |
  |    |   3    |
  |____|        |
  | 1  |        |
  |____|________|
  </code></pre>
  
  <p>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: </p>
  
  <pre><code> _____________
  |    |     |  |
  |    |     |  |
  |    |     |  |
  | 0  |     |  |
  |    |  3  |2 |
  |    |     |  |
  |    |     |  |
  |____|     |  |
  | 1  |     |  |
  |____|_____|__|
  </code></pre>
  
  <p>(note here tmux will most likely reorder it so the old 3 becomes the new pane #2)</p>
  
  <p>Currently when I try to run <code>join-pane -h</code> 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. </p>
  
  <p>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).</p>
  
  <p>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. </p>