Skip to content

Commit

Permalink
fix: copy and paste for tmux (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismayta committed Jun 21, 2024
1 parent 0bee481 commit de59288
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions conf/.tmux_osx.conf
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"

0 comments on commit de59288

Please sign in to comment.