From a20d1c68af5edb81e51f0f01a18534cbe2aae1c2 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Mon, 16 Dec 2024 11:46:14 +1030 Subject: [PATCH] fix: use xclip for clipboard in tmux --- .tmux.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 95341af..804c15e 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -51,6 +51,16 @@ bind-key -T copy-mode-vi 'y' send -X copy-selection bind 'V' copy-mode +# Enable clipboard integration +set-option -g set-clipboard on + +# Use xclip for copying text in copy mode +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -in" +bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -in" + +# Shortcut for manual copying outside of copy mode +bind-key C-c run-shell "tmux save-buffer - | xclip -selection clipboard -in" + # Enable mouse control (clickable windows, panes, resizable panes) set -g mouse on