BigOncleSam icon

VI COPY LINES

BigOncleSam | PRO | 11/06/18 01:44:00 PM UTC | 0 ⭐ | 5623 πŸ‘οΈ | Never ⏰ | []
VIM |

1.16 KB

|

None

|

0 πŸ‘

/

0 πŸ‘Ž

VI COPING BETWEEN FILES
Β 
VI editor is a very powerful editor. 
Suppose you want to copy
line numbers 1-10 and 23-77 of 
file A and paste them on file B at 
the same time, what will
you do ?? Here I am giving a tip 
to do this :- 
Β 
Place the cursor on line no. 1
Press ESCAPE
Press Shift "(Shift double quotes)
Press a
Press 10yy [the number of lines you 
want to copy]
Β 
Now place the cursor on line no. 23
Press ESCAPE
Press Shift "(Shift double quotes)
Press b
Press 55yy [the number of lines you 
want to copy]
Β 
Now the first 10 lines have been 
copied in buffer "a" and next
55 lines have been copied in 
buffer "b".
Β 
Now press " : " (COLON) to get 
the vi prompt.
Hit e "Destination file name"
Β 
Once you enter the Destination file 
go to the line where you
want the first 10 lines in buffer 
"a" to be inserted.
Β 
Press ESCAPE.
Press Shift "(Shift double quotes)
Press a.
Press p.
Β 
The first 10 lines in buffer "a" 
gets inserted.
Β 
Now go to the line where you want the 
rest 55 lines in buffer
"b" to be inserted.
Β 
Press ESCAPE.
Press Shift "(Shift double quotes)
Press b.
Press p.
Β 
The rest 55 lines in buffer "b" 
gets inserted.

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    πŸ‘

    /

    πŸ‘Ž