set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g mouse on
set -s set-clipboard off
#wl-copy-both is a script I put in ./local.bin
#!/bin/sh
# Read from stdin, copy to primary, then pass through to system clipboard
#input=$(cat)
#echo "$input" | wl-copy --primary
#echo "$input" | wl-copy
set -s copy-command 'wl-copy-both'
set-window-option -g mode-keys vi
set -g @yank_action 'copy-pipe-and-cancel'
set -g @override_copy_command 'wl-copy-both'
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'wl-copy-both'
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'wl-copy-both'
bind -n MouseDown2Pane run "tmux set-buffer \"$(wl-paste --primary)\"; tmux paste-buffer"
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
run '~/.tmux/plugins/tpm/tpm'
Saturday, October 11, 2025
tmux and expected clipboard behavior with ctrl-v and middle click
Surpisingly, this took me a while to tweak (with the help of AI prompts.) I wanted, what in my opinion, was a more consistant approach inside of tmux so that mouse wheel scroll and select with vi visual mode, both copied to both clipboards (the primary - mouse wheel selects) and the secondary ( keyboard copy paste.) I'll probably just end up using autocutsel so that it sync system wide (since I've yet to find a case where I did *not* want them in sync.) But until, then here is my tmux .. I also crated a wl-copy-both file that I put in /.local/bin that I describe below.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment