From 2321a97ccd1be177414f5e29b0c3b1fe1d711126 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Thu, 24 Mar 2022 23:57:16 -0400 Subject: [PATCH] tmux: Add plumb-on-right-click support This was a doozy to write (and I'm sure it can be done better), but it seems to be working and I'm happy with the outcome! It's not quite acme(1) but it'll do! --- .tmux.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index e558e38..b1376ab 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -11,9 +11,18 @@ unbind-key C-b bind-key C-a send-prefix # plumber! `a` in copy-mode sends to the 'plumb' command (A/Enter splits in new window) +# right-click also opens in the current window (a la Acme) bind-key -T copy-mode-vi a send-keys -X copy-pipe-no-clear "plumb #{pane_current_path}" bind-key -T copy-mode-vi A send-keys -X copy-pipe-no-clear "plumb -w #{pane_current_path}" bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "plumb -w #{pane_current_path}" +bind-key -T root MouseDown3Pane \ + select-pane \; copy-mode -M \; send-keys -X begin-selection \; \ + send-keys -X previous-space \; send-keys -X other-end \; send-keys -X next-space-end \; \ + send-keys -X copy-pipe-and-cancel "plumb #{pane_current_path}" +bind-key -T copy-mode-vi MouseDown3Pane \ + select-pane \; copy-mode -M \; send-keys -X begin-selection \; \ + send-keys -X previous-space \; send-keys -X other-end \; send-keys -X next-space-end \; \ + send-keys -X copy-pipe-and-cancel "plumb #{pane_current_path}" # Less delay on pressing escape (for vim) set-option -sg escape-time 10 -- libgit2 1.1.1