Files
dotfiles/tmux.linux.conf
2025-04-08 11:21:55 +01:00

14 lines
730 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Detect the display server protocol and set clipboard commands
if-shell '[ "$XDG_SESSION_TYPE" = "wayland" ]' \
'set -g copy-command "wl-copy"; set -g paste-command "wl-paste -n"' \
'set -g copy-command "xclip -sel clip -i"; set -g paste-command "xclip -sel clip -o"'
# Take the buffer and send it to the system clipboard
bind C-c run "tmux save-buffer - | $copy_command"
# y in copy mode takes selection and sends it to system clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$copy_command"
# And the reverse - Prefix Ctrl-v fills tmux buffer from system clipboard, then
# pastes from buffer into tmux window
bind C-v run-shell '$paste_command | tmux load-buffer - \; paste-buffer'