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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005