Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to replace a current line with what in a buffer using vi

Tags:

vim

buffer

Say i have line stored in buffer k. how do I replace some line with the content of the buffer?

like image 630
vehomzzz Avatar asked Dec 09 '09 14:12

vehomzzz


People also ask

How does the vi editor use buffers?

Whenever you delete something from a file, vi keeps a copy in a temporary file called the general buffer. You can also delete or copy lines into temporary files called named buffers that will let you reuse those lines during your current vi work session.


1 Answers

go anywhere on the line to be replaced. Execute a buffer P (Put above). Use dd to delete the current line.

so "xPdd

like image 97
Asklepius M.D. Avatar answered Nov 15 '22 15:11

Asklepius M.D.