Lesson 5: Copying and Moving Text In this lesson, we are going to learn how to delete whole blocks of text, rather than characters or words at a time. The command to delete lines is C--K. (C--K stands for "Kill line".) Move the cursor to the first line of this paragraph with C--P or C--N. Now type a C--K. Whatever was on that line has disappeared. Now type another C--K. The line itself has disappeared and all the other lines of text have been moved up. Now move the cursor to the first line of this paragraph, and move halfway into the line with C--F's or M--F's. Again, type a C--K. You will notice that only the part of the line to the right of the cursor was deleted. C--K deletes text starting with the character which the cursor is resting on until it reaches the end of the current line. In order to remove an entire line and its contents, you must type two C--K's. You will find this command useful for retyping previously existing lines of text, where you want to remove what the line (or the "rest" of the line, starting at the cursor) says, but want to replace it with something else. Typing many C--K's in a row could become burdensome, especially if you intend to delete an entire paragraph or chapter. Instead, Perfect Writer has a command (C--W) to wipe or delete an entire region of text. It is called the WIPE REGION command. In order to wipe clear a region of text, the text must first be marked off. One end of the region which C--W will wipe out is shown by where the cursor is in the text. The other end of the region is given by a "mark", which we will now learn how to set. The command which sets the invisible mark is Escape Space. Move the cursor to the beginning of some line in the middle of this paragraph. Type M--Space. Down in the echo line you should see the message "Mark Set." If not, try typing M--Space again, and if that doesn't work, type either a C--@ or a C--Space now, and use the one which works from now on, rather than the M--Space. Having figured that out, move to the end of the same line and type a C--W. Look at the text; the portion of it between the cursor (at the end of the line) and the invisible mark (at the beginning of the line) should have disappeared. Let's wipe clear something bigger than a line. Move the cursor to the beginning of this paragraph, and set the mark there by typing M--Space. Now move the cursor to the end of this paragraph and type a C--W. You shouldn't be able to read this sentence any more! What if we make a mistake and wipe out a huge block of text unintentionally? There is a command to retrieve the text which was just deleted, C--Y (for "Yank back deleted text"). Do that now: type a C--Y and the paragraph we just deleted should appear back where the cursor is now. Now move the cursor down a few lines and type C--Y again. Another copy of that text appears at the cursor. Type the C--Y again; the text should be replicated one more time. You've just learned how to copy or move text, all with one command, C--Y! To make a copy of some text, wipe it out (using M--Space and C--W) and immediately yank it back with a C--Y in that spot (i.e., without moving the cursor). Then, move the cursor to the spot where you would like the copy to appear, and type another C--Y. If you want to move a block of text rather than copy it, just don't type the C--Y at the original position. See the description of the Copy Region command in the Perfect Writer User's Guide. C--W is not the only command which saves text in case you want to yank it back. C--K, M--D, and M-- all save text as well. IN GENERAL, IF YOU DELETE ANYTHING LARGER THAN A CHARACTER, PERFECT WRITER WILL SAVE IT FOR YOU in case you want to move or copy it (or undo a mistake!). As an example, move the cursor to the beginning of this paragraph, and type a couple of C--K's. Notice that a "plus" sign has come on at the right edge of the mode line. This means that if you continue to type C--K's, the text deleted will be added on to whatever deleted text is already being stored. So, you can delete a region of text, with either an M--Space / C--W or with a series of C--K's (or even M--D's or some combination of all of these), and a C--Y will still yank the entire region back. Perfect Writer will only store your "most recent" block of text deletes, however. What determines what is "recent" and what is not? The plus-sign at the right of the mode line. If you are about to delete something larger than a character and the plus is not there, you will be clearing away whatever previous series of deletes you entered. In general, all this amounts to is that, if you give any movement commands or insert anything after deleting some text, you will "close off" the current group of deletes. (You will also see the plus-sign go off.) Any C--Y's you type after this will retrieve that group. Any C--K's, M--D's, M--'s, or C--W's you do after this will clear away that group of deletes and start a brand new one. There is a command to "turn on the plus sign". This is used if you want to move groups of lines from several different places all to one place. Certainly you could do this manually, doing a few C--K's, moving to the right place, doing a C--Y, going somewhere else and doing some C--K's or a C--W, moving back to the right place, doing another Control Y, etc. It would be much easier to do C--K's or C--W's in all the various places and then yank the whole thing back with a single C--Y. But we said earlier that movement away from the place of the text deleting or wiping causes the plus-sign to go off and the current bunch of deletes to be "closed off". The command to turn the plus sign back on is M--C--W. (This is your first "M--Control" command. Remember that you just type M--C--W.) You can remember this command by its close relation with the commands C--W and M--W. As M--C--W is difficult to think about, there is no substitute for practice. Move to the beginning of this paragraph and delete the text on the first line, in whatever manner is convenient. Then move to the last line. Notice that the plus in the mode line has gone off. Type an M--C--W to turn it on, then delete the text on the last line. Now move into the middle of what's left and type a C--Y. You will see both the first and last lines appear there at once. Experiment with all these commands for a while. Try doing C--W's with the cursor both before and after the invisible mark you set, and observe the results. Deleting and yanking text is one of the more complicated features of word processing. However, once you understand it, it's also one of the most useful and convenient features. Take your time and experiment enough to make sure that you understand these commands. When you're all done type a C--X C--C and answer "Y" for "yes" when Perfect Writer asks you if you want to abandon the text buffer without saving it. You do not want to alter the file "lesson5" for the next person. We'll learn more about text buffers and additional features available with C--Y and multiple buffers in Lesson 7.  the plus in the mode line has gone off. Type an M