Reputation: 489
I know there must be a way to do this. It's somewhat difficult to search this kind of tricks.
What I want is to copy lines from xx to yy and paste them where my cursor is. I know how to yank and paste, but I want to do this without moving my cursor to the lines where I want to copy and get back to the line where I want to paste.
Copy and paste without navigating lines is what I want.
Upvotes: 1
Views: 671
Reputation: 6053
You can do it this way:
:5,6copyN
, where N is the line under which the lines will copied to.
Note that, the line N must exist in your file, i.e. your cursor should be there at least once before you want to do copy/paste.
Upvotes: 1
Reputation: 4282
You can do this using the command-line mode. To yank line 2 to 20
:2,20y
then just hit p on the current line.
Upvotes: 1