This is a Tmux plugin that lets you rearrange your windows. I made this as an excuse to practice shell scripting.
tmux-windancer.mp4
Installation with TPM ⚙️
Add plugin to the list of TPM plugins in config file (like .tmux.conf):
set -g @plugin 'sycanz04/tmux-windancer'Hit Prefix + I to fetch the plugin and source it. You should now be able to use the plugin.
Prefix + P- Move window leftPrefix + N- Move window rightPrefix + Alt + w- Specify window to swap with
Note: The window rotates to the other end if it's at the left/rightmost corner
After installing the plugin.
- Navigate to .tmux plugin run file
$ cd ~/.tmux/plugins/tmux-windancer/tmux-windancer.tmux
- Change they keybinds on these 3 lines (default keybinds are
P,N,M-w)
tmux bind-key P run-shell "$CURRENT_DIR/scripts/dance.sh left"
tmux bind-key N run-shell "$CURRENT_DIR/scripts/dance.sh right"
tmux bind-key M-w command-prompt -p "Move window to index: " "run-shell '$CURRENT_DIR/scripts/dance.sh %%'"- Source your tmux config