lazybios
lazybios

Reputation: 489

how to copy/cut text from vim to system clipboard use line number

Be just like title,I know how to copy/cut to system clipboard "+yy,and it works! But my question is how can I use line number copy/cut section text,such as use :1,10y to yank 1 to 10 lines,can I use the same way to copy/cut to system clipboard,if can not ? Is there a simliar way for the same purpose ? (Actually,I have try to :1,10"+yy,but did not worked !)

Upvotes: 0

Views: 89

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172768

You only need the "{reg} prefix for normal mode, to indicate that you want to specify a register. For Ex commands, you just append the register name.

:1,10yank +

Learn how to look up commands and navigate the built-in :help; it is comprehensive and offers many tips. You won't learn Vim as fast as other editors, but if you commit to continuous learning, it'll prove a very powerful and efficient editor. :help :yank explains this:

:[range]y[ank] [x]       Yank [range] lines [into register x]. Yanking to the
                        "* or "+ registers is possible only when the
                        |+clipboard| feature is included.

Upvotes: 3

Related Questions