0

My copy of Vim has the +clipboard feature compiled in:

vim --version | grep clipboard
+clipboard       +job             +path_extra      +user_commands
+eval            +mouse_dec       +statusline      +xterm_clipboard

I'm trying to copy 1 and 2 lines into system clipboard with the command 1,2y"+.

An HTML file

When I check the + register with :reg +, I get the following output:

A random snippet of Vimscript

Why aren't the lines copied into my system register?

4

The problem is, " means start of a comment for :ex commands.

I think you actually want :1,2y + as this is the correct syntax for the :y command

  • It is not need to add a white space between y and +, :1,2y + is equal to :1,2y+,verified in vim. – it_is_a_literature Sep 7 '18 at 1:26

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.