Skip to content

Instantly share code, notes, and snippets.

@stephenmckinney
Created December 3, 2012 20:47
Show Gist options
  • Save stephenmckinney/4197891 to your computer and use it in GitHub Desktop.
Save stephenmckinney/4197891 to your computer and use it in GitHub Desktop.
Vim + Tmux + Mac OS X Clipboard (pbcopy) integration
# Mac OS X clipboard integration
set-option -g default-command "reattach-to-user-namespace -l zsh"
bind y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Optional keybindings: Enter Copy-mode and Copy and Paste sorta like Vim.
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy Escape cancel
" Mac OS X clipboard integration
nmap <F1> :set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
vmap <F2> :w !pbcopy<CR><CR>
brew install vim tmux reattach-to-user-namespace
@the-reverend
Copy link

thanks for sharing this.

@statico
Copy link

statico commented Jul 20, 2017

Thanks for this. How about mouse selection support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment