Tmux: Switch the split style of two adjacent panes

Prefix + Space is bound to next layout


# Here is a jewel of a bind which does the task of flipping the
# orientation of the current pane with the pane before it (in the
# ordering) -- I had a SO question on this and nobody answered.
bind -n M-f move-pane -t '.-'
bind M-f move-pane -t '.-'
bind -n M-r move-pane -h -t '.-'
bind M-r move-pane -h -t '.-'

The comment is a lie, this functionality is not intuitive and frankly sucks, but it does work in a pinch.

Update: I have since updated this to remove the -n binds in my config, basically you do want to leave open the ability to "pass through" the keystroke through tmux. For example after a while I desired the same exact functionality inside Vim, which I bound to the same combination.


UPDATE: Can combine with the great solution here: https://stackoverflow.com/a/70024796/340947

This allows you to grab a pane and walk it all around. Makes my binds obsolete but both could be kept (like I will) for the familiar behaviors. I don't really like that mine will do something confusing if you happen to run it on the first pane ('.-' would pick the bottom right pane in this case).


C-b space (bound to next-layout by default) cycles through available layouts


#flipping the orientation of the current pane with the pane <arrow-way>-of

    bind -n S-Up move-pane -h -t '.{up-of}'
    bind -n S-Right move-pane -t '.{right-of}'
    bind -n S-Left move-pane -t '.{left-of}'
    bind -n S-down move-pane -h -t '.{down-of}'

here are my example to change the otiantation with the pane in the way of the arrow only Press Shift and Arrow-key or rebind the command how you want