2

In a tmux session, I'm running vim in one pane and a terminal in another pane.
Recently, I figured out how to enter visual mode in tmux but it doesn't help much now.

Can I yank selected text from a pane and paste it to another (within vim or not), and how can I do this?
The other way, how can I yank some text from vim and paste it to another pane?

  • I could have sworn Ive answered something like this before, but I can’t find it. The answer is yes, there are tmux bindings that allow this (and tpope has a plugin, tbone I think, that makes it easy in vim). But if your question is about tmux and not vim, it’s off-topic here. – D. Ben Knoble Sep 22 at 12:36
  • Welcome to Vi and Vim! – filbranden Sep 22 at 17:45
0

Plugin vim-tmux-clipboard seems to be what you're after. It mirrors Vim's unnamed register (default one for yank, delete and put operations) to and from the tmux clipboard.

Make sure you take a close look at the requirements when enabling this plug-in. For Vim, you need at least version 8.0.1394 and you also need plug-in vim-tmux-focus-events to be enabled. (For NeoVim, there are no additional requirements.)

You also need to enable set -g focus-events on on tmux for it to work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.