Skip to content

Instantly share code, notes, and snippets.

@pgib
Last active December 2, 2017 09:54
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 pgib/e7af3dce8eb1bb6a68d6 to your computer and use it in GitHub Desktop.
Save pgib/e7af3dce8eb1bb6a68d6 to your computer and use it in GitHub Desktop.
Nice tmux copy and paste using OS X clipboard
# =======================================================================
# vim-style copy and paste
setw -g mode-keys vi
bind ] paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -t vi-copy Space rectangle-toggle
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# =======================================================================

Be sure to first run:

brew install reattach-to-user-namespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment