Below is the command used to Copy/paste a block of code(s) from Windows editor to Vi editor. Basically to replace complete text from a particular file.
First copy the block of code(s) from windows editor then go to Vi editor and use the following command sequentially as given below
<ESC>
d
Shift+g
i
Shift+Insert
<ESC>
Above command says delete (d) the codes form specific line number (0 in this case) upto end of the file i.e. last line (note - capital G, hence Shift+g). Then go to insert mode (i) and paste the copied lines.
First copy the block of code(s) from windows editor then go to Vi editor and use the following command sequentially as given below
<ESC>
d
Shift+g
i
Shift+Insert
<ESC>
Above command says delete (d) the codes form specific line number (0 in this case) upto end of the file i.e. last line (note - capital G, hence Shift+g). Then go to insert mode (i) and paste the copied lines.