From 01a1aea2afe5a7a63ca55d13a1552050ca3a772b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 18 May 2026 16:49:36 -0400 Subject: feat(tmux): mirror vterm-copy-mode key story in tmux copy-mode M-w copies and stays in mode so multiple selections can be grabbed in a row (was copy-selection-and-cancel). C-g exits (was clear-selection). Enter is unbound so RET has no copy-and-exit shortcut. q and Escape already cancel by default and are kept as-is. Mirrors the cj/vterm-tmux-history and vterm-copy-mode story on the Emacs side, so all three surfaces for lifting text out of a vterm share one key story. --- dotfiles/common/.tmux.conf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dotfiles/common/.tmux.conf b/dotfiles/common/.tmux.conf index 93a3238..071be99 100644 --- a/dotfiles/common/.tmux.conf +++ b/dotfiles/common/.tmux.conf @@ -77,8 +77,16 @@ set-option -g history-limit 100000 # don't allow suspending client unbind-key C-z -# emacs key bindings in tmux command prompt (prefix + :) -set -g status-keys emacs +# emacs key bindings in tmux command prompt (prefix + :) +set -g status-keys emacs + +# copy-mode keys mirror the Emacs cj/vterm-tmux-history story +# (~/.emacs.d/modules/vterm-config.el): M-w copies and stays in mode +# for repeated copying; q / Escape / C-g exit without copying; +# Enter is unbound so RET has no "copy and exit" shortcut. +bind-key -T copy-mode M-w send-keys -X copy-selection +bind-key -T copy-mode C-g send-keys -X cancel +unbind-key -T copy-mode Enter # install tmux plugins automatically when tmux is started if "test ! -d ~/.tmux/plugins/tpm" \ -- cgit v1.2.3