Vim yank to tmux clipboard

Solution 1:

It is not clear why you should use tmux clipboard.

I find it easier to copy to system clipboard from vim or any other application and them paste it on tmux. You could try following on your ~/.tmux.conf:

bind-key -n C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"

This allows to paste from system clipboard to tmux using Ctrl-V.

For further information on this approach: Tmux: Clipboard Integration.

Solution 2:

If youre working on a terminal and not a local vim process consider using vim-tbone which enables storing selections to the tmux buffer. It is a basic configuration to map the :Tyank :Tput commands to keyboard shortcuts of your choice (I use ty and tp respectively)