From d56c786a4afaf1d42c253073e8e2bc50ff6477cb Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Mon, 26 Feb 2024 17:40:51 -0500 Subject: [PATCH] Sync with the system clipboard instead of needing to manually do it using xclip (which also only works on x11) --- tmux.normal.conf | 7 +++---- tmux.powerline.conf | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tmux.normal.conf b/tmux.normal.conf index 2c974db..627cebf 100644 --- a/tmux.normal.conf +++ b/tmux.normal.conf @@ -44,6 +44,9 @@ set-window-option -g visual-activity off #show the activity being monitored for set-window-option -g xterm-keys on #generate xterm-style function key sequences for better compatibility set-window-option -g mode-keys vi #use vi-style keys in copy and choice modes # +# clipboard (sync with the system) +set -s set-clipboard external +# # mouse set-option -g mouse on bind -T root MouseDown3Pane send-keys -M #send right clicks to the application below @@ -109,10 +112,6 @@ bind / list-commands bind y copy-mode bind C-p paste-buffer # -# C-v and C-y to paste the X buffer, or copy the tmux buffer into X -bind C-v run "xclip -o | tmux load-buffer - ; tmux paste-buffer" -bind C-y run "tmux show-buffer | xclip -sel clip" -# # (copy mode) v,y and escape to select, copy and cancel respectively bind -Tcopy-mode-vi y send -X copy-selection bind -Tcopy-mode-vi v send -X begin-selection diff --git a/tmux.powerline.conf b/tmux.powerline.conf index c39816b..ebf898a 100644 --- a/tmux.powerline.conf +++ b/tmux.powerline.conf @@ -44,6 +44,9 @@ set-window-option -g visual-activity off #show the activity being monitored for set-window-option -g xterm-keys on #generate xterm-style function key sequences for better compatibility set-window-option -g mode-keys vi #use vi-style keys in copy and choice modes # +# clipboard (sync with the system) +set -s set-clipboard external +# # mouse set-option -g mouse on bind -T root MouseDown3Pane send-keys -M #send right clicks to the application below @@ -109,10 +112,6 @@ bind / list-commands bind y copy-mode bind C-p paste-buffer # -# C-v and C-y to paste the X buffer, or copy the tmux buffer into X -bind C-v run "xclip -o | tmux load-buffer - ; tmux paste-buffer" -bind C-y run "tmux show-buffer | xclip -sel clip" -# # (copy mode) v,y and escape to select, copy and cancel respectively bind -Tcopy-mode-vi y send -X copy-selection bind -Tcopy-mode-vi v send -X begin-selection