TEACH MOREVT100 This file describes features of VED which you will find useful when you want to make changes to a file you have written. They help you get the cursor quickly to where you want it, and allow you to delete text in chunks larger than one character at a time. --- SEARCHING FOR TEXT ----------------------------------------------- You have already seen how to move to a line whose number you know (ENTER- (line number)). However, if you are looking for a specific piece of text - a word, perhaps, or a group of words - you do not need to know the number of the line it is on; you can use the search facility built into VED. To give a search command, press ENTER, then type a '/' (at the lower right next to the SHIFT key) and then the text you are looking for. For example, ENTER-/stuart would search for the next occurrence of the letters 'stuart'. If 'stuart' occurs in several places, and the one found isn't the one you want, then you can press the REDO key (marked with a '-' sign, next to the '9' on the keypad). REDO tells VED to repeat the last command you gave it. REDO works with whatever command is showing on the command line. It is not restricted to search commands. Alternatively, if you give the ENTER-/ command and don't type any text before the RETURN, then VED will search for the next occurrence of the thing it last searched for. VED searches forwards. If it gets to the end of the file, it continues its search from the top, so if the wanted text is anywhere in the file (even above the cursor) then VED will find it. I.e. the search 'wraps around'. -- SEARCHING FOR A NON-EMBEDDED WORD -------------------------------------- If you want the search to find a word which is not embedded in another word, e.g. if you want to find 'the' but not 'then' or 'these', you can use the '"' symbol instead of '/'. Try both repeatedly with 'the' as the search string, and see what difference it makes. (First note the current line number, so that you can come back here) ENTER "the ENTER /the -- SEARCHING BACKWARDS ------------------------------------------------ If you use the '\' symbol instead of '/' then VED will search backwards. At present you can't tell it to search backwards for a non-embedded word. I.e. ENTER \the will find 'then' as well as 'the'. -- THE PF1 KEY --------------------------------------------------------- You have already seen the effect of pressing some of the keys on the keypad at the right of the keyboard. These keys behave differently if you precede them with a press of the PF1 key at the top left of the keypad. Many of the commands described below use a PF1-(other key) sequence. -- MOVING BACK TO SOMEPLACE YOU WERE BEFORE ---------------------------- When trying out the search commands above, you were asked to write down the number of the line you were on, so that you could come back later. In fact, there is a way of getting VED to remember your place for you. If you press the PF1 key, followed by the key marked '1' on the keypad, a note is made of your current position. To return to it later from somewhere else, you do PF1 followed by the '2' key on the keypad. If you do PF1-3, then you go back to the last remembered position, and your current position is remembered in its place. So you can use PF1-3 to hop back and forth between two places in a file. You can try remembering more than one position. In theory, successive PF1s followed by keypad '2's should take you through the various saved positions. In practice, VED limits the number of positions it saves, and so you may not be able to get back to all the positions you have noted. -- TOP AND BOTTOM OF FILE ---------------------------------------------- You can use PF1-UP-SCREEN and PF1-DOWN-SCREEN to get you respectively to the beginning and the end of the file. -- MORE ON DELETING TEXT ----------------------------------------------- The DEL key is not always the most convenient way of deleting text. There are several alternatives ways, using the PF1 key in conjunction with others on the keypad. PF1-8 deletes the character at the cursor position. PF1-7 deletes the character to the left of the cursor. PF1-9 deletes the character to the right of the cursor. PF1-5 deletes the whole of the line containing the cursor. The line below moves up to take its place. PF1-4 deletes everything on the line to the left of the cursor. It's like pressing DEL lots of times. PF1-6 deletes everything rightward from the cursor to the end of the line. PF1-WORD-LEFT (the keypad key marked with '0') deletes the word to the left of the cursor. PF1-WORD-RIGHT (the keypad key marked '.') deletes the word to the right of the cursor. For deleting even larger amounts of text it is best to use the MARK-RANGE facility. -- MARKING RANGES OF LINES --------------------------------------------- A number of VED commands work on a whole group of lines. The MARK-FIRST and MARK-LAST keys (PF2 and PF3 on the top row of the keypad) are used to indicate which lines. Position the cursor on the first line of interest and then press MARK-FIRST. Move the cursor to the last line of interest and then press MARK-LAST. A vertical line should appear at the left side of the text indicating the marked lines. Once a range of lines is marked, a variety of things can be done. For example, the marked lines can be moved somewhere else in the file. To do this, position the cursor just before the place you want the lines moved to and then do PF1-PF4 (the MOVE key). Alternatively, the marked lines can be deleted. To do this press ENTER and then give the command 'd' (and then press RETURN). -- THE REENTER KEY ----------------------------------------------------- The keypad key marked ',' (just above the ENTER KEY) is the REENTER key. Like ENTER, it moves the cursor to the command line, but, unlike ENTER, it does not erase the command that is already there. This means that you can correct typing mistakes on the command line, without having to retype the whole command. Note that you can use the keypad to perform deletions and move the cursor back and forth on the command line just as in the file itself. -- INSERTING AN EXTRA LINE ---------------------------------------------- Occasionally you will want to put a new line of text between two existing lines. PF1 followed by the MARK-FIRST key (PF2) inserts a new blank line above the line containing the cursor. PF1-MARK-LAST (PF3) inserts a new blank line below the cursor. -- STATIC MODE --------------------------------------------------------- Normally when you insert or delete characters in the middle of a line, the text to the left of the cursor moves right or left to accomodate the change. There are cases, especially in the preparation of tables, when it is more convenient for the rest of the line to remain where it is. If you press PF1 followed by the MOVE key (PF4), VED will change its behaviour so that insertions and deletions do not cause the rest of the line to move about. When VED is behaving in this way it is said to be in static mode. A second PF1-MOVE will take you back from static mode to normal functioning. -- TIDYING UP A PARAGRAPH ---------------------------------------------- When you come to type in a lot of text, you will eventually find that some paragraphs become untidy due to text having been inserted or deleted. Whilst it is possible to tidy such paragraphs explicitly by breaking and joining lines in appropriate places, it is easier to have the computer do it. Move the cursor to a position within the untidy paragraph and then press ENTER and give the 'jp'(join paragraph) command (followed by RETURN). This command takes a minute or two to do its stuff, and does some strange things to the screen while it is working.