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

后端 未结 18 1474
南方客
南方客 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:14

    Example: fileA and fileB - start in fileA at line 25, copy 50 lines, and paste to fileB

    fileA
    
    Goto 25th line
    
    25G
    
    copy 50 lines into buffer v
    
    "v50yy
    
    Goto fileB
    
    :e fileB
    
    Goto line 10
    
    10G    
    
    paste contents of buffer v
    "vp
    

提交回复
热议问题