| Lesson 9 | Pasting text between files |
| Objective | Cut, copy, and paste text between files within a vi session. |
5dW deletes five words and stores them in a buffer. To put the buffer contents back in the file, you must use the p or P command. If you make another edit before the "put", the unnamed buffer is overwritten by the new edit.a to z.
At any time during your session, the contents of the buffer can be restored (retrieved) by using a put command, p or P."), then the buffer name, then the appropriate command to copy, delete, or put your text.
For example:| Command | Description |
"a5yy | Yank (copy) 5 lines into buffer a |
"aP | Put the contents of buffer a before the cursor |
"bd) | Delete from the cursor to the end of the sentence, and store this in buffer b |
"bp | Put the contents of buffer b after the cursor. |