-
-
Save rodricels/7951c3bd505d343b07309b76188af9b3 to your computer and use it in GitHub Desktop.
| # My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf | |
| # Scroll History | |
| set -g history-limit 50000 | |
| # show messages for 4 seconds instead | |
| set -g display-time 4000 | |
| # set first window to index 1 (not 0) to map more to the keyboard layout | |
| set-option -g renumber-windows on | |
| set -g base-index 1 | |
| setw -g pane-base-index 1 | |
| # Make mouse useful, tmux > 2.1 include select, resize pane/window and console wheel scroll | |
| set -g mouse on | |
| # Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access. | |
| set -s escape-time 50 | |
| ## Clipboard integration | |
| # ctrl+c to send to clipboard | |
| bind C-c run "tmux save-buffer - | xclip -i -sel clipboard" | |
| # ctrl+v to paste from clipboard | |
| bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" | |
| # Selection with mouse should copy to clipboard right away, in addition to the default action. | |
| unbind -n -Tcopy-mode-vi MouseDragEnd1Pane | |
| bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null" | |
| # Middle click to paste from the clipboard | |
| unbind-key MouseDown2Pane | |
| bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" | |
| # Drag to re-order windows | |
| bind-key -n MouseDrag1Status swap-window -t= | |
| # Double click on the window list to open a new window | |
| bind-key -n DoubleClick1Status new-window |
tyvm! i'm probably odd, but prefer "unified clipboard" (whether ctrl-* or mouse, do the same) so also found it useful that xclip lets you specify multiple select args...
xclip -se c -se p -i -r
Thank you for sharing this! Exactly solved my clipboard problems
thank you for sharing!
ty
In centos8 stream pre install xclip , this config work well , thanks a lot~!
thanks for sharing your configs
thanks. this is the one.
Thanks a ton for this. I simply cut and pasted line 22 to 34. I am finally able to copy error messages from my terminal to browser.
I keep getting this error when selecting text to copy it:
'tmux save-buffer - | xclip -i -sel clipboard > /dev/null' returned 1
It still works, it just hits me with that warning every time.
Thanks a bunch! I can finally have working right-click paste in mouse mode!
I made this small adjustment to have putty style right click paste under wayland (foot terminal):
bind-key -n MouseDown3Pane run "tmux set-buffer \"$(wl-paste)\"; tmux paste-buffer"
thanks for sharing, finally found a way to restore right click to paste with mouse mode on with tmux version >2.1
PS: but I still can only make it paste from tmux's copy, not from other windows ( I'm using windows's chrome secure shell for ssh )
tried this too, same result with above
bind-key -n MouseDown3Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"