DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Editing files

Using buffers to cut and paste text

vi has 26 buffers, named ``a'' through ``z'', where it can store text temporarily. You can use buffers to:

The contents of buffers disappear altogether when you quit vi.

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: "bufferp. 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.


Next topic: Placing markers
Previous topic: Editing more than one file

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003