vi has 26 buffers, named ``a'' through ``z'', where it can store text temporarily. You can use buffers to:
To cut (delete) a line of text and store it in a buffer, type "bufferdd.
To copy (yank) a line of text into a buffer, type the command "bufferyy or "bufferY. For example, "iyy copies the current line into buffer ``i''.
To store several lines, precede the cut or copy command with the number of lines you wish to copy; for example, to copy fifteen lines into buffer ``j'', type "j15Y.
To paste the contents of the last buffer you used into the text on the line
immediately below the cursor, type the command p.
You can insert the contents of any buffer by specifying
the buffer name:
For example, to paste the contents of buffer ``g'' into your file
below the cursor, type "gp. The command "gP
places the text above the cursor.