From dab8031935910650c59460c36e0aa0f384af24d5 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Tue, 22 Aug 2023 16:55:43 +0100
Subject: [PATCH] feat(tmux): add `join-pane` key bind

Add a key binding for re-joining another window into a pane within the
current window, which is the opposite of the `break-pane` command.

It prompts for the window to join from and then joins it into a vertical
pane within the current window.

This was taken from Chris Toomey's dotfiles. See
https://github.com/christoomey/dotfiles/blob/553c92a3a1fd7f05f2283ab8c45feffcefea5d5b/tmux/tmux.conf#L60
---
 system/shared/home-manager.nix | 1 +
 1 file changed, 1 insertion(+)

diff --git a/system/shared/home-manager.nix b/system/shared/home-manager.nix
index e2e9a971..fce5bda3 100644
--- a/system/shared/home-manager.nix
+++ b/system/shared/home-manager.nix
@@ -434,6 +434,7 @@ in
 
       # Break a pane into a new window.
       bind-key b break-pane -d
+      bind-key J command-prompt -p "join pane from: "  "join-pane -h -s '%%'"
 
       bind-key C-j choose-tree