-2

I'm using Manjaro, and open clipboard:

➜  ~ vim --version | grep "clipboard"
+clipboard      +jumplist      +persistent_undo     +vertsplit
+emacs_tags     +mouse_dec     -sun_workshop        +xterm_clipboard

First question, use "+y can't copy the current line to clipboard, and "+yy could copy current line to clipboard. I don't know why.

And If I set vnoremap <leader>y "+y, use commmand <leader>yy in vim can't work (what I expect is <leader>yy action as same as "+yy).

What's more, is there a way set a mapping to let <leader>yny action as same as "+yny?

Thanks for any help.

roachsinai
  • 111
  • 4

1 Answers1

-1

I think you seriously misunderstand how vi and vim work. See :help y, :help operator, and :help movement. IMHO the most of vim's appeal is in the logic of combinations of operators and motions.

The first y is operator (yank), the second one is motion - and in vim most, if not all, operators when repeated work on the whole line (dd - delete line, cc - change line.)

I am not at all sure what you expect "+yny would do, but it is copying (y) into clipboard ("+) from current location to next occurrence of search term (n), and then starting another copy (y) and waiting for motion.

Martian
  • 874
  • 4
  • 9