From 208e3009fc795538c86c5b8ca2ee2c9e1dbd4c90 Mon Sep 17 00:00:00 2001 From: xs Date: Sun, 8 Nov 2026 20:18:50 +0800 Subject: tmux: prefix-] pastes with bracketed paste (-p) so vim inserts it verbatim --- core/tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/tmux.conf') diff --git a/core/tmux.conf b/core/tmux.conf index d0d3ef8..8a21bef 100644 --- a/core/tmux.conf +++ b/core/tmux.conf @@ -45,9 +45,9 @@ bind-key -T copy-mode-vi y if-shell -F '#{selection_present}' { send-keys -X cop bind-key -T copy-yy y send-keys -X select-line \; send-keys -X copy-pipe-no-clear "$YANK" bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK" -# pull (paste): prefix + ] fetches the buffer into tmux, then pastes it; +# pull (paste): prefix + ] fetches the buffer into tmux, then pastes it (-p: bracketed paste, so vim inserts it as-is even from normal mode); # no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer -bind-key ] run-shell "f=\$(mktemp); $CLIP '[ -f /dev/shm/clip/buf ] || exit 3; cat /dev/shm/clip/buf' >\$f; r=\$?; [ \$r -eq 0 ] && tmux load-buffer \$f; rm -f \$f; [ \$r -eq 0 ] || [ \$r -eq 3 ] && tmux paste-buffer" +bind-key ] run-shell "f=\$(mktemp); $CLIP '[ -f /dev/shm/clip/buf ] || exit 3; cat /dev/shm/clip/buf' >\$f; r=\$?; [ \$r -eq 0 ] && tmux load-buffer \$f; rm -f \$f; [ \$r -eq 0 ] || [ \$r -eq 3 ] && tmux paste-buffer -p" # ===== end shared clipboard ===== # TODO: try `set -g set-clipboard off` later (tmux default "external" sends copies to the local terminal clipboard via OSC 52); unrelated to the shared clipboard above -- cgit