TEACH MOREVED Revised A.Sloman Oct 1987 MORE ON MOVING AROUND AND SEARCHING FILES ========================================= This file assumes that you have worked through TEACH TEACH and that you have a keyboard map available to tell you which function keys correspond to VED operations on the terminal you are using. The remainder of this file describes features which are useful but not essential. If you feel you'd rather get on with other things, you can leave this file with q You can come back later, with the command teach moreved From now on, to indicate that a special key is being named angle brackets will be used as in , , . INDEX FOR THIS FILE (Put cursor on required topic then type g ) -- WORD MOVEMENT LEFT OR RIGHT -- MOVING TO A LINE WHOSE NUMBER IS KNOWN -- SEARCHING FOR A KNOWN STRING: / -- SEARCHING BACKWARDS: \ -- SEARCHING FOR A NON-EMBEDDED WORD: " -- REPEATING THE SEARCH COMMAND: REDO KEY or / or \ -- RETURNING TO SOMEPLACE YOU WERE BEFORE: PUSH and POP -- MORE ON DELETING TEXT -- TEACH FILES -- REVISION QUESTIONS -- HELP FILES -- FURTHER INFORMATION -- WORD MOVEMENT LEFT OR RIGHT ---------------------------------------- On most terminals a pair of keys will be available for WORDLEFT and WORDRIGHT moves, as described in TEACH VED. If you don't have these marked on your terminal, you can get the same effect with f (forward) and b (backward). I.e. to do WORDRIGHT, first press the key and then press the "F" key. The simple cursor movement keys are very inconvenient if you want to move a long way or to some specific line. Since people often want to move to the beginning or end of the file special keys are provided for this purpose: ENDFILE and TOPFILE. On some terminals this requires two keys to be pressed. The keyboard map should indicate what is needed. E.g. it may be the "REFRESH" key followed by the SCREENUP or SCREENDOWN key. Or it may be the key followed by the SCREENUP or SCREENDOWN key. Alternatively you may be able to do it by pressing a "FUNCTION" key and another key at the same time. -- MOVING TO A LINE WHOSE NUMBER IS KNOWN ------------ If you know the line number that you want to get to you can use an command. Suppose you want to get to line 40. You can do the following. Try it. Press: Type: 40 Press: . Make a note of this line number. Then go to line 10, and come back here, using followed by the line number. -- SEARCHING FOR A KNOWN STRING: / ---------------------------- If you're not sure of a line's number but you are sure what is in it, then you can use the search facility built into VED. To give a search command, press , then press '/' (not to be confused with '\') and then the text you are looking for. For example, if you wish to search for the letters 'foo' then type /foo This makes VED search for the next line containing the letters 'foo'. If more than one line contains 'foo' and the line found isn't the one you want then you can press the REDO key to search again. (Look at your keyboard map to see where the REDO key is. It is often somewhere near the key.) The REDO button tells VED to repeat the last command you gave it. Alternatively, if you give an empty search string, then VED will search for the thing it last searched for, e.g. / 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 process 'wraps around' the file. -- 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. \the will find 'then' as well as 'the'. Try it. -- SEARCHING FOR A NON-EMBEDDED WORD: " ------------------------ As you may already have discovered, the ' /foo' command will find embedded occurrences of 'foo' as in 'foot' and 'foolish'. This can be prevented by using the double quote mark '"' instead of the slash '/'. So if you want to find 'the' but not 'then' or 'these', you can use the '"' symbol instead of '/'. Try both the following two commands 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): "the /the If you wish you can seach for strings including space, e.g. /the next line Try it, and then use the REDO button till you get back here. If you wish to search for a string ending in a space, then you must terminate the search string with the search character, e.g. /the / "the " \the \ will all search for an occurrence of 'the' followed by a space. The first and last, but not the second one, may make you seethe because they find the word "seethe" followed by a space, as in the previous line. -- REPEATING THE SEARCH COMMAND: REDO KEY or / or \ ------- The REDO button (usually somewhere near ) can be used to repeat the search whether it is backwards or forwards. This works if the last command was a search command. However, you can repeat the last search without using an command or the REDO key. To search forward (with wrap around) for the next occurrence of the last search string used, do: / (i.e. press the key then the '/' key once each). This operation is called RE_SEARCH. To search backward for the last thing searched for, do: \ -- RETURNING TO SOMEPLACE YOU WERE BEFORE: PUSH and POP --------------- Earlier you probably tried the ENDFILE key and then had a hard time getting back to the point you were at before. This happens so often that two special keys have been devoted to solving this problem. They are called POSITIONPUSH and POSITIONPOP. You will need to inspect your keyboard map to see where they are. They may be referred to simply as PUSH and POP. The POSITIONPUSH button tells VED to remember where in the file you currently are. A subsequent POSITIONPOP will take you back to the last position saved by POSITIONPOP. Try that now, by pressing POSITIONPUSH, ENDFILE keys and POSITIONPOP. You can try 'pushing' more than one position. In theory, successive 'pops' 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 'stacked' by using the PUSH key. If you are constantly switching between two parts of the same file, the EXCHANGEPOSITION key is very useful. It swaps the current cursor position with the last position put on the position stack. On many keyboards this can be done by the sequence p. E.g. press the POSITIONPUSH key now then go to the top of the file (VEDTOPFILE key) then type p and repeat a few times. You will see VED jump back and forth between the two positions. If you move the cursor in between it will modify the stored position accordingly when you next to p. -- MORE ON DELETING TEXT ---------------------------------------------- The CHARDELETE key (often marked "DEL") is not always the most convenient way of deleting characters. The file TEACH VED explains several more, e.g. WORDLEFTDELETE, WORDRIGHTDELETE, CLEARHEAD, CLEARTAIL, LINEDELETE, VEDDOTDELETE. If your terminal does not have a DOTDELETE key (i.e. a key for deleting the character immediately under the cursor), then you can try using CTRL-R instead. (I.e. hold down the CTRL key then tap the "R" key -- this may not work on all terminals.) If you are not already familiar with them, try all those keys, and make a note of how they work. You could use VED to create a file called KEYS in which you type summaries of how to do things with keys in VED. E.g. type ved keys To get back to this file use x as explained in TEACH SWITCHWINDOW. For deleting even larger amounts of text it is best to use the MARK-RANGE facility with d, as described in TEACH MARK. Once a range of lines has been marked, a variety of things can be done to the text, deleting, copying, moving to another place, compiling, formatting, etc. See TEACH MARK for more information. -- TEACH FILES -------------------------------------------------------- The file you are reading is one among several TEACH files. You can look at a directory list of the teach files by doing teach index try that. At this stage you should not try to find your way round the files without help from your teacher. More detailed information is provided by: teach teachfiles There may also be additional "local" teach files added to your Poplog system. If so you will have to ask the persons responsible what they are called, so that you can get at them. -- REVISION QUESTIONS ------------------------------------------------- Write answers to the following in a file called 'venotes'. You can then look at it again later to get a quick summary of what you have learnt from this and other teach files. How, in VED do you - make the cursor move left or right a word at a time - jump to line 53 - search forward or search backward - search for a string not embedded in a longer word - re-do the last command on the command line - re-do the last search command without using the redo key. _ tell VED to remember the current cursor position so that you can jump back to it. How do you jump back to it? -- HELP FILES --------------------------------------------------------- VED includes a HELP command. This accesses files which are like TEACH files but tend to assume you are more experienced, and so they are more compressed. Try HELP HELP -- FURTHER INFORMATION ------------------------------------------------ For further information on VED try the following comands TEACH MARK More on marking ranges and doing something to the marked range. HELP VEDKEYS Summarises the use of function keys and control characters. It may also tell you about a HELP file for the type of VDU you are using. For more advanced users: HELP VEDCOMMS A summary of the most widely used ENTER commands HELP VEDSEARCH Searching and Substituting in VED HELP VEDMACROS Tells you how to define your own VED 'macros' See also the VED User Guide, which should be available from your Poplog supplier. Note: In some of the help files the ENTER commands are referenced by prefixing them with 'ved_', to get the name of the procedure that actually does the work. So the q command works by running the procedure ved_q, the t command works by running the procedure ved_t (see TEACH MARK). There are a few exceptions, e.g. 33 goes to line 33, but there is no procedure ved_33. Similarly there are not procedure ved_/ and ved_\ corresponding to the search commands / and \. Instead VED directly recognises the \ and / symbols on the command line. (The reason has to do with making it unnecessary to type an extra space after "\" or "/" when searching.) If you have had enough of this file you can type q to "quit" this file then go back to something else. If you want to leave the Poplog system altogether, type bye RETURN If you have edited any of your own files the new versions will be 'written' onto the magnetic disk. --- C.all/teach/moreved --------------------------------------------------- --- Copyright University of Sussex 1987. All rights reserved. ----------