#print When you enter the vi editor, it will show you the first screenful of your file. If your file is shorter than the size of your screen, the lines past the end of the file will appear blank, with a tilde (~) in the first column. This is so that you can tell where the end of your file is, even when it ends in a blank line. In a moment, you'll go into vi and be able to see this for yourself. There are two commands to keep in mind in case of difficulties with vi: first, the 'Escape' key. This key is usually located near the upper lefthand corner of the keyboard. Whenever you aren't sure whether vi is listening to you or what state it's in, just hit Escape a few times, until it beeps. The key is truly harmless and will make vi go back to its normal state. The second command is used whenever the screen gets messed up; for example, when someone writes you a message. Just hit the 'L' key while holding down the 'CTRL' or Control button. This is usually called 'Control-L' and written '^L'. The ^L command will clear and redraw the screen, leaving the cursor where it was. On some terminals, ^R must be used instead of ^L; we'll explore this in a moment, when you're inside the editor. You'll now be placed inside the editor. You'll be given instructions on what to do when you get there. Type 'ready' now to enter vi. #user #create QuitTest You are now inside the vi editor. Note the name and numbers at the bottom of the screen. They tell you that you're editing the file named QuitTest and how many lines and characters the file has. The tildes in the first column of several of the lines near the bottom of the screen represent lines beyond the end of this file. First, try out the Escape command. Hitting Escape should make the terminal beep. Now, try out the ^L command. ^L should make the screen clear and be redrawn. (Remember, ^L is typed by holding down the 'Control' key and hitting 'L'). On some types of terminals the ^L command doesn't work. If when you typed ^L nothing happened except for the cursor moving one letter to the right, you're using one of those terminals. In this case, use ^R (hold down 'Control' and hit 'R') to redraw the screen. Make sure you know which one will work for you. The other command you'll need to know right now is the command to quit and get out of the editor. (Oh, yeah....) First, hit the colon key, ':'. The cursor should move to the bottom line of the screen and print a colon. Vi is now ready for a 'colon-command'. Now type a 'q'. When you hit the return key, you'll leave the editor. If it doesn't work, it means you accidentally made changes to the file and vi doesn't want you to lose them. We don't care about this file, though, so just type ':q!' and it will give up. Bye!! # vi QuitTest #next 1.2 10