Created
December 3, 2019 10:17
-
-
Save quentin/ad4eea0d151e132f180e543a14bd3df0 to your computer and use it in GitHub Desktop.
tmux copy/paste configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## tested with tmux 3 | |
# mouse mode | |
set -g mouse on | |
setw -g mode-keys vi | |
# selection with mouse copies to clipboard in addition to the default action | |
unbind-key -n -T copy-mode-vi MouseDragEnd1Pane | |
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -sel primary" | |
# middle click to paste from the clipboard | |
unbind-key MouseDown2Pane | |
bind-key -T root MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel primary)\"; tmux paste-buffer" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment