4

To move cursor on the 4th line,toggle into normal mode,input 8yy.
To move cursor to 15th line,and toggle into normal mode,press p .

Now the lines from 4th till 11th was pasted from 15th till 22th line.

Can all the steps can be repalced with a command in ex mode?

To make it clear.
primitive file from target file enter image description here

How to change primitive file into target file with a command in ex mode?

1
  • 6
    Don't post text as screenshots. It takes up a lot of space, you can't copy from it, and it's not even more readable. Apr 23, 2017 at 11:47

1 Answer 1

12

I'm not sure if I understand you correctly but is this what you're looking for?

:4,11t 15

This will copy lines from 4 to 11 and paste it on line 15.

See :h co for more.

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.