|
|
1.1 root 1: You are looking at the JOVE tutorial. This was written by Richard Stallman
2: and modified by Doug Kingston and Jonathan Payne. Comments on this document
3: should be sent to payne@rochester. (12 February '86)
4:
5: JOVE commands generally involve the CONTROL key (sometimes labelled
6: CTRL or CTL) or the META key (generally labelled ESCAPE). Rather than
7: write out META or CONTROL each time we want you to prefix a character,
8: we'll use the following abbreviations:
9:
10: C-<chr> means hold the CONTROL key while typing the character <chr>
11: Thus, C-F would be: hold the CONTROL key and type F.
12: M-<chr> means type the META (ESCAPE) key and release it, then type
13: the character <chr>. The <chr> can be upper or lower case
14: and it will have the same meaning.
15:
16: Important note: if you must exit at some point, type C-X C-C.
17: The characters ">>" at the left margin indicate directions for you to
18: try using a command. For instance:
19:
20: >> Now type C-V (View next screen) to move to the next screen.
21: (go ahead, do it by depressing the control key and V together).
22: From now on, you'll be expected to do this whenever you finish
23: reading the screen.
24:
25: Note that there is an overlap when going from screen to screen; this
26: provides some continuity when moving through the file.
27:
28: The first thing that you need to know is how to move around from
29: place to place in the file. You already know how to move forward a
30: screen, with C-V. To move backwards a screen, type M-V (depress the
31: META key and type V, or type <ESC>V if you don't have a META or EDIT
32: key).
33:
34: >> Try typing M-V and then C-V to move back and forth a few times.
35:
36:
37: SUMMARY
38: -------
39:
40: The following commands are useful for viewing screenfuls:
41:
42: C-V Move forward one screenful
43: M-V Move backward one screenful
44: C-L Center the current line--clear screen and redisplay
45: everything if current line is already at center.
46:
47: >> find the cursor and remember what text is near it.
48: Then type a C-L.
49: Find the cursor again and see what text is near it now.
50:
51:
52: BASIC CURSOR CONTROL
53: --------------------
54:
55: Getting from screenful to screenful is useful, but how do you
56: reposition yourself within a given screen to a specific place? There
57: are several ways you can do this. One way (not the best, but the most
58: basic) is to use the commands previous, backward, forward and next.
59: As you can imagine these commands (which are given to JOVE as C-P,
60: C-B, C-F, and C-N respectively) move the cursor from where it
61: currently is to a new place in the given direction. Here, in a more
62: graphical form are the commands:
63:
64: Previous line, C-P
65: :
66: :
67: Backward, C-B .... Current cursor position .... Forward, C-F
68: :
69: :
70: Next line, C-N
71:
72: You'll probably find it easy to think of these by letter. P for
73: previous, N for next, B for backward and F for forward. These are the
74: basic cursor positioning commands and you'll be using them ALL the
75: time so it would be of great benefit if you learn them now.
76:
77: >> Do a few C-N's to bring the cursor down to this line.
78:
79: >> Move into the line with C-F's and then up with several C-P's. See
80: what C-P does when the cursor is in the middle of the line.
81:
82: Lines are separated by a single Linefeed character, which is what Unix
83: calls a Newline.
84:
85: >> Try to C-B at the beginning of a line. Do a few more C-B's.
86: Then do C-F's back to the end of the line and beyond.
87:
88: When you go off the top or bottom of the screen, the text beyond the
89: edge is shifted onto the screen so that your instructions can be
90: carried out while keeping the cursor on the screen.
91:
92: >> Try to move the cursor off the bottom of the screen with C-N and
93: see what happens.
94:
95: If moving by characters is too slow, you can move by words. M-F
96: (Meta-F) moves forward a word and M-B moves back a word.
97:
98: >> Type a few M-F's and M-B's. Intersperse them with C-F's and C-B's.
99:
100: Notice the parallel between C-F and C-B on the one hand, and M-F and
101: M-B on the other hand. Very often Meta characters are used for
102: operations related to English text whereas Control characters operate
103: on the basic textual units that are independent of what you are
104: editing (characters, lines, etc). There is a similar parallel between
105: lines and sentences: C-A and C-E move to the beginning or end of a
106: line, and M-A and M-E move to the beginning or end of a sentence.
107:
108: >> Try a couple of C-A's, and then a couple of C-E's.
109: Try a couple of M-A's, and then a couple of M-E's.
110:
111: See how repeated C-A's do nothing, but repeated M-A's keep moving
112: farther. Do you think that this is right?
113:
114: Two other simple cursor motion commands are M-< (Meta Less-than),
115: which moves to the beginning of the file, and M-> (Meta Greater-than),
116: which moves to the end of the file. You probably don't need to try
117: them, since finding this spot again will be boring. If you need the
118: shift key to type a "<", then you must also use the shift key to type
119: M-<. Otherwise, you would be typing M-, .
120:
121: The location of the cursor in the text is also called "point". To
122: paraphrase, the cursor shows on the screen where point is located in
123: the text.
124:
125: Here is a summary of simple moving operations including the word and
126: sentence moving commands:
127:
128: C-F Move forward a character
129: C-B Move backward a character
130:
131: M-F Move forward a word
132: M-B Move backward a word
133:
134: C-N Move to next line
135: C-P Move to previous line
136:
137: C-A Move to beginning of line
138: C-E Move to end of line
139:
140: M-A Move back to beginning of sentence
141: M-E Move forward to end of sentence
142:
143: M-< Go to beginning of file
144: M-> Go to end of file
145:
146: >> Try all of these commands now a few times for practice. Since the
147: last two will take you away from this screen, you can come back
148: here with the command C-X C-X (which will be explained later).
149: These are the most often used commands.
150:
151: Like all other commands in JOVE, these commands can be given arguments
152: which cause them to be executed repeatedly. The way you give a
153: command a repeat count is by typing META and then the digits before
154: you type the command. (Remember META is ususally called ESCAPE)
155:
156: For instance, META 8 C-F moves forward eight characters.
157:
158: >> Try giving a suitable argument to C-N or C-P to come as close
159: as you can to this line in one jump.
160:
161: The only apparent exception to this is the screen moving commands, C-V
162: and M-V. When given an argument, they scroll the screen up or down by
163: that many lines, rather than screenfuls. This proves to be much more
164: useful.
165:
166: >> Try typing M-8 C-V now.
167:
168: Did it scroll the screen up by 8 lines? If you would like to scroll
169: it down you can give an argument to M-V.
170:
171:
172: QUITTING FROM COMMANDS
173: ----------------------
174:
175: The character in JOVE used to quit out of all commands which request
176: input is C-G. For example, you can use C-G to discard a numeric
177: argument or the beginning of a command that you don't want to finish.
178:
179: >> Type M-100 to make a numeric arg of 100, then type C-G. Now type
180: C-F. How many characters does it move? If you have typed an <ESC>
181: by mistake, you can get rid of it with a C-G.
182:
183:
184: ERRORS
185: ------
186:
187: Sometimes you may do something which JOVE doesn't allow. If it is
188: something simple, such as typing a control key sequence which is not
189: associated with any command, JOVE will just beep at you. Otherwise,
190: JOVE will also display an informative error message at the bottom of
191: the screen.
192:
193: Some versions of JOVE do not have all the features described in this
194: tutorial implemented yet. If you come across such an unimplemented
195: feature, you may get an error message when you try to use it. Just
196: proceed on to the next section of the tutorial.
197:
198:
199: INSERTING AND DELETING
200: ----------------------
201:
202: If you want to type text, just do it. Characters which you can see,
203: such as A, 7, *, etc. are taken by JOVE as text and inserted
204: immediately. Type <Return> (the carriage-return key) to insert a line
205: separator.
206:
207: You can delete the last character you typed by typing <Delete>.
208: <Delete> is a key on the keyboard, which may be labeled "Rubout"
209: instead of "Delete" on some terminals. More generally, <Delete>
210: deletes the character immediately before the current cursor position.
211:
212: >> Do this now, type a few characters and then delete them by typing
213: <Delete> a few times. Don't worry about this file being changed;
214: you won't affect the master tutorial. This is just a copy of it.
215:
216: >> Now start typing text until you reach the right margin, and keep
217: typing. When a line of text gets too big for one line on the
218: screen, the line of text is "continued" off the edge of the screen
219: The exclamation mark at the right margin indicates a line which has
220: been continued. The line will slide over if you move off the edge
221: on either side.
222:
223: >> The following line actually goes off the edge. Trying typing enough
224: C-F's that you move off the right hand end of this line.... This is a long line of text that the JOVE editor extends to the right.
225:
226: >> Use <Delete>s to delete the text until the line fits on one screen
227: line again. The continuation "!" will go away.
228:
229: >> Move the cursor to the beginning of a line and type <Delete>. This
230: deletes the line separator before the line and merges the line onto
231: the previous line. The resulting line may be too long to fit, in
232: which case it has a continuation indication.
233:
234: >> Type <Return> to insert the separator again.
235:
236: Remember that most JOVE commands can be given a repeat count; Note
237: that this includes characters which insert themselves.
238:
239: >> Try that now -- type META 8 * and see what happens.
240:
241: If you want to create a blank line in between two lines, move to the
242: second of the two lines and type C-O.
243:
244: >> Try moving to a line and typing C-O now.
245:
246: You've now learned the most basic way of typing something in JOVE and
247: correcting errors. You can delete by words or lines as well. Here is
248: a summary of the delete operations:
249:
250: <Delete> delete the character just before the cursor
251: C-D delete the next character after the cursor
252:
253: M-<Delete> kill the word immediately before the cursor
254: M-D kill the next word after the cursor
255:
256: C-K kill from the cursor position to end of line
257: M-K kill to the end of the current sentence
258:
259: Notice that <Delete> and C-D vs M-<Delete> and M-D extend the parallel
260: started by C-F and M-F (well, <Delete> isn't really a control
261: character, but let's not worry about that). C-K and M-K are like C-E
262: and M-E, sort of, in that lines are opposite sentences.
263:
264: Now suppose you kill something, and then you decide that you want to
265: get it back? Well, whenever you kill something bigger than a
266: character, JOVE saves it for you. To yank it back, use C-Y. Note
267: that you don't have to be in the same place to do C-Y; This is a good
268: way to move text around. Also note that the difference between
269: "Killing" and "Deleting" something is that "Killed" things can be
270: yanked back, and "Deleted" things cannot. Generally, the commands
271: that can destroy a lot of text save it, while the ones that attack
272: only one character, or nothing but blank lines and spaces, do not save.
273:
274: For instance, type C-N a couple times to postion the cursor at some
275: line on this screen.
276:
277: >> Do this now, move the cursor and kill that line with C-K.
278:
279: Note that a single C-K kills the contents of the line, and a second
280: C-K kills the line itself, and make all the other lines move up. If
281: you give C-K a repeat count, it kills that many lines AND their
282: contents.
283:
284: The text that has just disappeared is saved so that you can retrieve
285: it. To retrieve the last killed text and put it where the cursor
286: currently is, type C-Y.
287:
288: >> Try it; type C-Y to yank the text back.
289:
290: Think of C-Y as if you were yanking something back that someone took
291: away from you. Notice that if you do several C-K's in a row the text
292: that is killed is all saved together so that one C-Y will yank all of
293: the lines.
294:
295: >> Do this now, type C-K several times.
296:
297: Now to retrieve that killed text:
298:
299: >> Type C-Y. Then move the cursor down a few lines and type C-Y
300: again. You now see how to copy some text.
301:
302: What do you do if you have some text you want to yank back, and then
303: you kill something else? C-Y would yank the more recent kill. But
304: the previous text is not lost. You can get back to it using the M-Y
305: command. After you have done C-Y to get the most recent kill, typing
306: M-Y replaces that yanked text with the previous kill. Typing M-Y
307: again and again brings in earlier and earlier kills. When you have
308: reached the text you are looking for, you can just go away and leave
309: it there. If you M-Y enough times, you come back to the starting
310: point (the most recent kill).
311:
312: >> Kill a line, move around, kill another line. Then do C-Y to get
313: back the second killed line. Then do M-Y and it will be replaced
314: by the first killed line. Do more M-Y's and see what you get.
315: Keep doing them until the second kill line comes back, and then a
316: few more. If you like, you can try giving M-Y positive and negative
317: arguments.
318:
319:
320: FILES
321: -----
322:
323: In order to make the text you edit permanent, you must put it in a
324: file. Otherwise, it will go away when your invocation of JOVE goes
325: away. While you are editing a file in JOVE, your changes are actually
326: being made to a private "scratch" copy of the file. However, the
327: changes still don't become permanent until you "save" the file. This
328: is so you can have control to avoid leaving a half-changed file around
329: when you don't want to.
330:
331: If you look near the botton of the screen you will see a line that
332: looks like this:
333: JOVE (Text) Buffer: teach-jove "teach-jove" *
334: "teach-jove" is the name of the file you are editing. This is the name
335: of your own temporary copy of the text of the JOVE tutorial; the file
336: you are now editing. Whatever file you edit, that file's name will
337: appear in that precise spot.
338:
339: The commands for finding and saving files are unlike the other
340: commands you have learned in that they consist of two characters.
341: They both start with the character Control-X. There is a whole series
342: of commands that start with Control-X; many of them have to do with
343: files, buffers, and related things, and all of them consist of
344: Control-X followed by some other character. As with M- the character
345: interpreted the same regardless of case.
346:
347: Another thing about the command for finding a file is that you have to
348: say what file name you want. We say the command "reads an argument
349: from the terminal" (in this case, the argument is the name of the
350: file). After you type the command
351:
352: C-X C-F Find a file
353:
354: JOVE will ask you for the file name. You should end the name with
355: the Return key. After this command, you will see the contents of the
356: file in your JOVE. You can edit the contents. When you wish to make
357: the changes permanent, issue the command
358:
359: C-X C-S Save the file
360:
361: Warning: on many systems JOVE will not be able to process the key C-S.
362: In place of C-S, you should type C-\. It is possible to make C-S work
363: but C-\ is guaranteed always to work in place of C-S.
364:
365: The old version of the file will be replaced. When the operation is
366: finished, JOVE prints the name and number of lines and characters
367: saved.
368:
369: If you forget to save and then edit a different file, JOVE will remind
370: you that you made changes that have not been saved and then ask you
371: whether you really want to quit. (If you don't save them, they will
372: be thrown away. That might be what you want!) You should answer with
373: a "Y" to throw the changes away or "N" to abort quitting so you can
374: then save the changes.
375:
376: To make a new file, just edit it "as if" it already existed. Then
377: start typing in the text. When you ask to "save" the file, JOVE will
378: really create the file with the text that you have inserted. From
379: then on, you can consider yourself to be editing an already existing
380: file.
381:
382: It is not easy for you to try out editing a file and continue with the
383: tutorial. But you can always come back into the tutorial by starting
384: it over and skipping forward. So, when you feel ready, you should try
385: editing a file named "FOO", putting some text in it, and saving it;
386: then exit from JOVE and look at the file to be sure that it worked.
387:
388:
389: EXTENDING THE COMMAND SET
390: -------------------------
391:
392: There are many, many more JOVE commands than could possibly be put on
393: all the control and meta characters. JOVE gets around this with the X
394: (eXtend) command. This comes in two flavors:
395:
396: C-X Character eXtend. Followed by one character.
397: M-X Named command eXtend. Followed by a long name.
398:
399: These are commands that are generally useful but used less than the
400: commands you have already learned about. You have already seen two of
401: them: the file commands C-X C-F to Find and C-X C-S to Save. Another
402: example is the command to tell JOVE that you'd like to stop editing.
403: The command to do this is C-X C-C.
404:
405: There are many C-X commands. The ones you need immediately are:
406:
407: C-X C-V Visit file.
408: C-X C-S Save file.
409: C-X C-C Quit JOVE. This does not save your files auto-
410: matically, though if your files have been modi-
411: fied, JOVE asks if you really want to quit. The
412: standard way to save and exit is C-X C-S C-X C-C.
413:
414: Named eXtended commands are commands which are used even less
415: frequently, or commands which are used only in certain modes. These
416: commands are usually called "commands". An example is the command
417: "apropos", which prompts for a keyword and then gives the names of all
418: the commands that apropos for that keyword. When you type M-X, JOVE
419: prompts you at the bottom of the screen with ":" and you should type
420: the name of the command you wish to call; in this case, "apropos".
421: Just type "apr<Space>" and JOVE will complete the name. JOVE will ask
422: you for a keyword or phrase and you type the string that you want ask
423: about.
424:
425: >> Try typing M-X, followed by "apropos" or "apr" and then Return.
426: Then try typing "file" followed by a Return.
427:
428:
429: TEXT REPLACEMENT
430: ---- -----------
431:
432: >> Move the cursor to the blank line two lines below this one.
433: Then type M-r changed<Return>altered<Return>.
434:
435: Notice how this line has changed: you've replaced the word
436: c-h-a-n-g-e-d with "altered" wherever it occurs after the cursor.
437:
438: The more customary command for replacing strings is the interactive
439: command query-replace-search, which has several options. In essence,
440: it shows each occurance of the first string and asks you if you want to
441: replace it or not. You can also choose to edit around the string, or
442: go on and replace all occurances without asking further. It is
443: described in detail in the JOVE manual.
444:
445:
446: MODE LINE
447: ---------
448:
449: If JOVE sees that you are typing commands slowly it shows them to you
450: at the bottom of the screen in an area called the echo area. The echo
451: area contains the bottom line of the screen. The line immediately above
452: them is called the MODE LINE. The mode line says something like
453:
454: JOVE (Text) Buffer: [buffername] "filename" *
455:
456: This is a very useful "information" line.
457:
458: The buffername is the name JOVE gave to the buffer, and it is usually
459: related to the filename. You already know what the filename means --
460: it is the file you have edited.
461:
462: The star means that you have made changes to the text. Right after
463: you visit or save a file, there is no star.
464:
465: The part of the mode line inside the parentheses is to tell you what
466: modes you are in. The default mode is Text which is what you are in
467: now. It is an example of a "major mode". There are several major
468: modes in JOVE for editing different languages and text, such as C
469: mode, Lisp mode, Text mode, etc. At any time one and only one major
470: mode is active, and its two-letter code can always be found in the
471: mode line just where "Text" is now. Each major mode makes a few
472: commands behave differently. For example, what JOVE considers as part
473: of a valid expression or an identifier differs from one major mode to
474: another, since each programming language has a different idea of what
475: is a legal identifier.
476:
477: Major modes are called major because there are also minor modes. They
478: are called minor because they aren't alternatives to the major modes,
479: just minor modifications of them. Each minor mode can be turned on or
480: off by itself, regardless of what major mode you are in, and
481: regardless of the other minor modes. So you can use no minor modes,
482: or one minor mode, or any combination of several minor modes.
483:
484: One minor mode which is very useful, especially for editing English
485: text, is "Auto Fill" mode. When this mode is on, JOVE breaks the line
486: in between words automatically whenever the line gets too long. You
487: can turn this mode on by doing M-X auto-fill-mode<Return>. When the
488: mode is on, you can turn it off by doing M-X auto-fill-mode<Return>--
489: it toggles.
490:
491: >> Type "M-X auto-fill-mode<Return>" now. Then insert a line with a
492: bunch of words over again until you see it divide into two lines.
493: You must put in spaces between them because Auto Fill breaks lines
494: only at spaces. Notice that "Fill" (the code for Auto Fill) appears
495: in the mode line after "Text" to indicate that you are in Text Fill
496: mode.
497:
498: The margin is usually set at 78 characters, but you can change it with
499: the set command. The margin is kept in a variable just like the mode
500: values.
501:
502: >> Type "M-X set right-margin 20", then type in some text and see
503: JOVE fill lines of 20 characters with it. Then set the margin
504: back to 72 using M-X set again.
505:
506:
507: SEARCHING
508: ---------
509:
510: JOVE can do searches for strings (these are groups of contiguous
511: characters or words) either forward through the file or backward
512: through it. To search for the string means that you are trying to
513: find that string somewhere in the file. Remember to use C-\ where it
514: says C-S.
515:
516: >> Now type C-S to start a search. Type the word 'cursor', then
517: Return.
518:
519: >> Type C-S Return to find the next occurrence of "cursor".
520:
521: The C-S starts a search that looks for any occurrence of the search
522: string AFTER the current cursor position. But what if you want to
523: search for something earlier in the text? To do this one should type
524: C-R for reverse search. Everything that applies to C-S applies to C-R
525: except that the direction of the search is reversed.
526:
527:
528: GETTING MORE HELP
529: -----------------
530:
531: In this tutorial we have tried to supply just enough information to
532: get you started using JOVE. There is so much available in JOVE that
533: it would be impossible to explain it all here. However, you may want
534: to learn more about JOVE since it has numerous desirable features that
535: you don't know about yet. JOVE has a some internal documentation.
536:
537: The most basic HELP feature is the describe-key command which is
538: available by typing C-X ? and then a command character. JOVE prints
539: one line line on the bottom of the screen tell what command is bound to
540: that key. You can then get further information on that command
541: using...
542:
543: The describe-command command M-? will prompt for the name of a command
544: and print out the section from the manual about that command. When you
545: are finished reading it, type a Space or a C-G (quit) to bring your text
546: back on the screen.
547:
548: >> Type C-X ? Control-P. The message at the bottom of the screen should
549: be something like "C-P is bound to previous-line".
550:
551: Multi-character commands such as C-X C-Z and <ESC>V are also allowed
552: after C-X ?.
553:
554: Now lets get more information about the previous-line command.
555:
556: >> Type M-? previous-line. When you are finished reading the
557: output, type a Space.
558:
559: The "name of the command" is important for people who are customizing
560: JOVE. It is what appears in the JOVE CHART as the documentation for
561: the command character.
562:
563: One other form of help is the "apropos" command. We have already tried
564: using this command in an earlier part of this tutorial, but it should
565: be mentioned again here. Apropos prompts for a word or phrase and
566: lists all the commands that contain that string. If you couldn't
567: remember the name of a certain command to read file, you could run the
568: apropos command with the keyword "file" and it would list all the
569: commands that contain "file". To run apropos you would type
570:
571: M-X apr<Space>file<Return>
572:
573:
574: CONCLUSION
575: ----------
576:
577: Remember, to exit use C-X C-C.
578:
579: This tutorial is meant to be understandable to all new users, so if
580: you found something unclear, don't sit and blame yourself - complain!
581:
582: You'll probably find that if you use JOVE for a few days you won't
583: be able to give it up. Initially it may give you trouble. But remember
584: that this is the case with any editor, especially one that can do many,
585: many things. And JOVE can do practically everything.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.