Skip to content

Instantly share code, notes, and snippets.

@mcescalante
Created November 8, 2016 21:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcescalante/004e649d8484574ce9d296ad69a80a08 to your computer and use it in GitHub Desktop.
Save mcescalante/004e649d8484574ce9d296ad69a80a08 to your computer and use it in GitHub Desktop.
My OSX/macOS tmux configuration, tested on 10.11.x
#allow mousing
set -g mouse-utf8 on
set -g mouse on
# Return pre-2.1 mousing behaviour
# https://github.com/tmux/tmux/issues/145
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'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "pbcopy"
# # Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "pbcopy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment