I'm aware that :swap-pane -U
and :swap-pane -D
will swap panes up or down, but I'd like a keybinding to swap panes left and right.
The only way I can think of to do this would be to first determine the pane index of the current pane, then run :select-pane -R
or -L
and determine its index, and finally run :swap-pane -s (first pane index) -t (second pane index)
.
I'm just not sure how to do this in .tmux.conf
- is it possible to have subcommands which return something within another command?
For example, something like this:
bind-key -n C-{ swap-pane -s **get current pane ID** -t **get pane ID of 'select-pane -L'**
bind-key -n C-} swap-pane -s **get current pane ID** -t **get pane ID of 'select-pane -R'**