j9wnfw
Last Updated: June 29, 2016
·
10.74K
· athal7

Vim & Tmux & System Clipboard

UPDATE: Fortunately, it seems some recent updates to vim and tmux have made this dead simple, in your .vimrc, add set clipboard^=unnamed

If you happen to be on older version or are having issues otherwise, here are the previous instructions that may still be useful for you:

  • brew install macvim --override-system-vim && brew linkapps
  • brew install reattach-to-user-namespace
  • in .vimrc: set clipboard=unnamed
  • in .tmux.conf: set-option -g default-command "reattach-to-user-namespace -l bash"

View this and other helpful system configurations here

7 Responses
Add your response

6155

brew install macvim now

over 1 year ago ·
6173

thanks! updating

over 1 year ago ·
13360

brew install macvim --override-system-vim && brew linkapps

This will alias vim, vi, view, vimdiff, etc.

To see all commands aliased, you might try ls -l /usr/local/bin | grep macvim

over 1 year ago ·
13409

thanks @smlstvnh, updated!

over 1 year ago ·
17714

Awesome! Automatically sending to tmux when I yank from vim is something I had been looking for, it totally worked. Thanks.

over 1 year ago ·
23653

is there an equivalent package in apt-get ?

over 1 year ago ·
27327

@louisgmoore so sorry for the delayed response! there was something funky going on with coderwall and it wouldn't let me comment, but now I can :).

From a quick search it looks like you might have some luck with xclip or xsel, but I haven't tested it myself.

over 1 year ago ·