UY-Scuti

Mouse mode for tmux

Jan 3rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. set -g mouse on
  2. bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
  3. bind -n WheelDownPane select-pane -t= \; send-keys -M
  4. bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
  5. bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
  6. bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
  7. bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
  8. bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
  9.  
  10. # To copy, left click and drag to highlight text in yellow,
  11. # once you release left click yellow text will disappear and will automatically be available in clibboard
  12. # # Use vim keybindings in copy mode
  13. setw -g mode-keys vi
  14. # Update default binding of `Enter` to also use copy-pipe
  15. unbind -T copy-mode-vi Enter
  16. bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
  17. bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
Add Comment
Please, Sign In to add comment