Copy and paste content from one file to another file in vi

后端 未结 18 1483
南方客
南方客 2020-12-04 05:02

I am working with two files, and I need to copy a few lines from one file and paste into another file. I know how to copy (yy) and paste (p) in the same file. But that doesn

18条回答
  •  旧巷少年郎
    2020-12-04 05:21

    You can open the other file and type :r file_to_be_copied_from. Or you can buffer. Or go to the first file, go on the line you want to copy, type "qY, go to the file you want to paste and type "qP.

    "buffer_name, copies to the buffer. Y is yank and P is put. Hope that helps!

提交回复
热议问题