Copy and paste in in Tmux and Vim: have we reach a consensus?

I am trying to use Tmux and Vim for better efficiency. Unfortunately, there is a copy/paste issue, as it is not possible to use the Vim visual mode between two panes of Tmux.

Several methods have been discussed in this 9-years-old post, but they are tedious: How to paste text from Vim editor to browser?

I was wondering if a consensus has been reached nowadays on the best method to use?


Solution 1:

I'm assuming that you want to copy-paste between 2 vim processes running in 2 different tmux panes.
You can do this by adding the following to your ~/.vimrc:

" Enable copying from vim to the system-clipboard
set clipboard=unnamedplus  

Now you copy in 1 vim process, navigate to your other vim process using tmux, and paste.

This also works if vim is running in another tmux window. Or if you want to paste from vim to another process (e.g. your browser).

For more information you can run: :help 'clipboard' inside vim.