Skip to content

Instantly share code, notes, and snippets.

@tophopstop
Last active August 17, 2017 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tophopstop/a9c97250f76083b1f7cae7336cfa7bae to your computer and use it in GitHub Desktop.
Save tophopstop/a9c97250f76083b1f7cae7336cfa7bae to your computer and use it in GitHub Desktop.
Set Up Copy to MacOs Clipboard with tmux 2.5 on MacOs Sierra
# get 'reattach-to-user-namespace' util with home brew
brew install reattach-to-user-namespace
# then, add these to your .tmux.conf and start/restart
setw -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# how to use
# 1. enter copy mode: control+b, [
# 2. use vi style navigation to get to where you want to start copying
# 3. 'v' to start selection
# 4. use vi style navigation to get to the end of your desired selection.
# 5. 'y' to copy the selection to clipboard (and bonus: exit tmux copy mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment