Last active
August 17, 2017 19:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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