Last active
December 8, 2016 05:10
-
-
Save 7696122/deda9db019146b6716fbde284a86226d to your computer and use it in GitHub Desktop.
Work around copy and paste for thus
This file contains hidden or 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
# https://robots.thoughtbot.com/how-to-copy-and-paste-with-tmux-on-mac-os-x | |
# pbcopy, pbpaste for TMUX | |
# brew install reattach-to-user-namespace | |
set-option -g default-command "reattach-to-user-namespace -l $SHELL" | |
# For emacs mode | |
################################################################ | |
# setw -g mode-keys emacs | |
# To copy: | |
# bind-key -t emacs-copy C-w copy-selection | |
bind-key -n -t emacs-copy M-w copy-pipe "reattach-to-user-namespace pbcopy" # or "xclip -i -sel p -f | xclip -i -sel c " | |
bind-key -n -t emacs-copy C-w copy-pipe "reattach-to-user-namespace pbcopy" # or "xclip -i -sel p -f | xclip -i -sel c " | |
# For vi mode | |
################################################################ | |
# To paste: | |
# bind-key -n C-y run "xclip -o | tmux load-buffer - ; tmux paste-buffer" | |
# Use vim keybindings in copy mode | |
# setw -g mode-keys vi | |
# Setup 'v' to begin selection as in Vim | |
# bind-key -n -t vi-copy v begin-selection | |
# bind-key -n -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" | |
# Update default binding of `Enter` to also use copy-pipe | |
# bind-key -n -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment