Skip to content

Instantly share code, notes, and snippets.

@chrishunt
Last active April 30, 2024 03:41
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrishunt/6042695 to your computer and use it in GitHub Desktop.
Save chrishunt/6042695 to your computer and use it in GitHub Desktop.
vim/tmux copy paste in mac os x

Shared Clipboard: vim,tmux,macos

One clipboard to rule them all. Requires tmux >= 1.8. Thanks @thoughtbot

Tell vim to use the system clipboard:

" ~/.vimrc
set clipboard=unnamed " use the system clipboard

Install reattach-to-user-namespace:

$ brew install reattach-to-user-namespace

Send the tmux clipboard to pbcopy:

# ~/.tmux.conf
# copy with 'enter' and send to mac os clipboard: http://goo.gl/2Bfn8
unbind -t vi-copy Enter
bind-key -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