From 93b562f7717cab41a76cb0aba29c0813feba7613 Mon Sep 17 00:00:00 2001 From: Brian Morton Date: Mon, 22 Jun 2026 17:43:50 -0700 Subject: [PATCH 1/2] Add window moving support to tmux.conf --- .devcontainer/tmux.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.devcontainer/tmux.conf b/.devcontainer/tmux.conf index bca5cb1..00ceebe 100644 --- a/.devcontainer/tmux.conf +++ b/.devcontainer/tmux.conf @@ -1,4 +1,5 @@ set -g default-terminal "screen-256color" + #---------------------------- # Key bindings #---------------------------- @@ -19,7 +20,17 @@ bind -n S-down new-window bind -n S-left prev bind -n S-right next # quick view of processes -bind '~' split-window "exec htop" +bind '~' split-window "exec top" + +#---------------------------- +# Window moving / reordering +#---------------------------- +# Shift+Up: prompt for a target index and swap the current window there. +# Focus follows the window to its new slot (no -d). +bind -n S-up command-prompt -p "move window to:" "swap-window -t '%%'" +# Renumber all windows sequentially to close gaps left by closed windows. +bind R move-window -r + #-------------------------- # Statusbar #-------------------------- @@ -36,6 +47,7 @@ set-window-option -g window-status-style fg=white,bg=default,dim set-window-option -g window-status-current-style fg=white,bg=default,bright # command/message line colors set -g message-style fg=white,bg=black,bright + #---------------------------- # Miscellaneous #---------------------------- From 602b50a54cf8f3467dd4c8cbd08a1f11973362c6 Mon Sep 17 00:00:00 2001 From: Brian Morton Date: Mon, 22 Jun 2026 18:14:17 -0700 Subject: [PATCH 2/2] Enable automatic window renumbering in tmux Enable automatic renumbering of windows in tmux. --- .devcontainer/tmux.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/tmux.conf b/.devcontainer/tmux.conf index 00ceebe..f616f72 100644 --- a/.devcontainer/tmux.conf +++ b/.devcontainer/tmux.conf @@ -30,6 +30,8 @@ bind '~' split-window "exec top" bind -n S-up command-prompt -p "move window to:" "swap-window -t '%%'" # Renumber all windows sequentially to close gaps left by closed windows. bind R move-window -r +# Automatically insert windows in the gaps when we create new ones +set-option -g renumber-windows on #-------------------------- # Statusbar