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?

1 Answer 1

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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