diff options
| author | xs <xs@xs.local> | 2026-11-08 20:18:50 +0800 |
|---|---|---|
| committer | xs <xs@xs.local> | 2026-11-08 20:18:50 +0800 |
| commit | 208e3009fc795538c86c5b8ca2ee2c9e1dbd4c90 (patch) | |
| tree | c4bbbe7f1778e90cc0e9d23b94fe56d04eb64349 /core/tmux.conf | |
| parent | fadb49c6a77b7784f7cbe41a7363d92b1d0023c0 (diff) | |
tmux: prefix-] pastes with bracketed paste (-p) so vim inserts it verbatim
Diffstat (limited to 'core/tmux.conf')
| -rw-r--r-- | core/tmux.conf | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
| 45 | bind-key -T copy-yy y send-keys -X select-line \; send-keys -X copy-pipe-no-clear "$YANK" | 45 | bind-key -T copy-yy y send-keys -X select-line \; send-keys -X copy-pipe-no-clear "$YANK" |
| 46 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK" | 46 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK" |
| 47 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK" | 47 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK" |
| 48 | # pull (paste): prefix + ] fetches the buffer into tmux, then pastes it; | 48 | # pull (paste): prefix + ] fetches the buffer into tmux, then pastes it (-p: bracketed paste, so vim inserts it as-is even from normal mode); |
| 49 | # no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer | 49 | # no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer |
| 50 | 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" | 50 | 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" |
| 51 | # ===== end shared clipboard ===== | 51 | # ===== end shared clipboard ===== |
| 52 | # 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 | 52 | # 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 |
| 53 | 53 | ||
