From de59288b8b1c04a4ac31bac6a143972ec0da7955 Mon Sep 17 00:00:00 2001 From: Luis Mayta Date: Fri, 21 Jun 2024 16:00:08 -0300 Subject: [PATCH] fix: copy and paste for tmux (#59) --- conf/.tmux_osx.conf | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/conf/.tmux_osx.conf b/conf/.tmux_osx.conf index 446c4fc..32ab25d 100644 --- a/conf/.tmux_osx.conf +++ b/conf/.tmux_osx.conf @@ -1,22 +1,16 @@ set -g mode-keys vi +setw -g mode-keys vi +set -g set-clipboard off set-option -g default-command 'exec reattach-to-user-namespace -l zsh' -bind-key -T vi-copy y 'reattach-to-user-namespace pbcopy' -bind-key -T emacs-copy M-w 'reattach-to-user-namespace pbcopy' - -bind -T copy-mode C-c send -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy" +bind-key -T vi-copy y 'reattach-to-user-namespace pbcopy' +bind -T copy-mode C-c send -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy" bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "reattach-to-user-namespace pbcopy" - -bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' - -bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy' - +bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" - bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" - bind -T copy-mode-vi DoubleClick1Pane send -X select-word \; send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" bind -n DoubleClick1Pane copy-mode -M \; send -X select-word \; send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" @@ -25,4 +19,9 @@ bind-key C-c run-shell 'tmux save-buffer - | reattach-to-user-namespace pbcopy' bind-key C-v run-shell 'reattach-to-user-namespace pbpaste | tmux load-buffer - \; paste-buffer -d' +bind-key -T copy-mode-vi v send-keys -X begin-selection + +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" + bind P run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"