|             |
|     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.

  • 1
    Sounds interesting - but can you describe what exactly you want to do? Which programms to run, what to share exactly? (Buffer could mean several things here) Commented Apr 15, 2015 at 22:31
  • In vim, there are buffers, but that seems not to be what you talk about (see :help buffers in vim). Also, tmux uses the term "buffer" for paste bufferes - if you want to do something with a tmux buffer involving vim, what you do is all in tmux, working on the output of vim (in a pane or maybe buffer) Commented Apr 16, 2015 at 3:27
  • Ya sorry my language in regards to this kind of stuff is really weak.... as i am self taught and tend to learn based on my needs and nothing more. I will try and clarify... Commented Apr 16, 2015 at 18:26
  • So I was right, it's interesting indeed! Commented Apr 16, 2015 at 20:47
  • If you're using an X-unaware vim it's going to be a challenge; gvim can use GTK's clipboard to yank between instances, but the console version doesn't have a good way for instances to talk to each other (or indeed to any external program). However, assuming you have a clipboard-enabled build and are just using it in console mode, you can set clipboard=unnamedplus which uses the X primary selection as the backend for yank.
    – Bandrami
    Commented Apr 17, 2015 at 4:58

2 Answers 2


The two vim instances are completely separate from each-other, but there are two possibilities to do this.

  1. 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.

  2. 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.

  • I try to do #2, but sometimes my workflow takes in in a direction that ends up in the state that I've described. I'll check out how i might leverage #1. Commented Apr 17, 2015 at 14:26

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .