Skip to content

Instantly share code, notes, and snippets.

@Echostream
Last active June 21, 2016 16:57
Show Gist options
  • Save Echostream/d37e0bc0b545dabcdb6416c6b4b94b98 to your computer and use it in GitHub Desktop.
Save Echostream/d37e0bc0b545dabcdb6416c6b4b94b98 to your computer and use it in GitHub Desktop.
Enable mouse actions in tmux 2.1
set -g mouse on
set -g mouse-utf8 on
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
#Press Ctral for scrolling faster
bind -t vi-copy C-WheelUpPane halfpage-up
bind -t vi-copy C-WheelDownPane halfpage-down
bind -t emacs-copy C-WheelUpPane halfpage-up
bind -t emacs-copy C-WheelDownPane halfpage-down
bind -n MouseDrag1Pane if -Ft= "#{mouse_any_flag}" 'if -Ft= "#{pane_in_mode}" "copy-mode -M" "send-keys -M" ' "copy-mode -M; send-key -M; run 'sleep 1; tmux save-buffer - | xclip -i >/dev/null'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment