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
Written by Andrew Thal
Related protips
7 Responses
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/10250/ea2273b4310db9ac0109dfaefd489a06.jpeg)
brew install macvim
now
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/16332/56b0b10e79eea3c98fb88c91ef0c6a5e.jpeg)
thanks! updating
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/119506/none.jpg)
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
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/16332/56b0b10e79eea3c98fb88c91ef0c6a5e.jpeg)
thanks @smlstvnh, updated!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/47844/36822056_1028067900681116_6227993812342407168_n.jpg)
Awesome! Automatically sending to tmux when I yank from vim is something I had been looking for, it totally worked. Thanks.
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/137350/57MiVeqr_normal.jpg)
is there an equivalent package in apt-get ?
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/16332/56b0b10e79eea3c98fb88c91ef0c6a5e.jpeg)
@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.