+-------------+ | | | 1 | | | |=============| | | | 2 | | | +-------------+
Each tmux split has vim open. I would like to do stuff like yank a line from 1 and paste then into 2 with the vim shortcuts.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The two vim instances are completely separate from each-other, but there are two possibilities to do this.
If your version of vim was compiled with X clipboard support you can use eg.
"+yy to yank the current line to the X clipboard register, alternatively putting
set clipboard=unnamed in your
vimrc to yank to the clipboard by default. See
:help registers for some information on vim registers.
vim has built in support for split windows, so another option is to use the built in splits instead of using tmux window splitting. See
:help windows or this linux.com article for more information about them.
To check for X clipboard support you can run
vim --version and see if there’s a plus before
xterm_clipboard in the output. If there’s a minus instead it means that your vim was built without X clipboard support and you’ll either have to get a copy with it, or use the second solution.
Make sure vim --version contains +clipboard. To have more natural copy&paste, you can add the following to your .vimrc. CTRL+Shift+v should be set by default to paste from system clipboard.
set clipboard=unnamedplus vnoremap <C-c> "+y
Using tmux, to copy and paste between two panes more quickly, I uploaded my configuration here: tvp-repl