2

I'm using the latest version of vim 8.2.148 on the latest version of arch linux 5.5.6-arch1-1 with the latest version of Openbox window manager version 3.6.1.

I have written a document in vim and need to yank parts of it and paste them into a web form.

Is there a command in vim to yank to the system wide / openbox clipboard so that I can paste into the chromium web form?

Yank seems to work inside vim only.

1
  • 2
    Welcome to Vi/Vim SE. I'm sure I've seen answers here before that cover this. Did you try the Search box up top? If you found some but they were missing some critical detail please note that. – B Layer Mar 8 '20 at 1:31
3

First get into an appropriate visual mode. v selects the standard visual mode, SHIFT-v selects visual-line mode, and CTRL-v selects visual block mode. Next, select the text that you want to select. Finally, "+y.

  • " means register.

  • + specifies the system clipboard register.

  • y is yank.

So "+y yanks into the system clipboard register.

more info on registers:

2
  • I has to install neovim to get this to work. My native vim install did not support copy to system wide clipboard. – Kes Mar 8 '20 at 17:33
  • 1
    You might want to check your vimrc and plugins on your native vim install. Some sort of misconfiguration could be interfering. It should work out of the box. However, nvim is better anyway. – JMW Mar 8 '20 at 18:12

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