📄 teach-jove
字号:
J O V E T U T O R I A L Welcome to JOVE - an advanced, easy-to-use, user-friendly environment for editing text, programs or anything else you may like to type.JOVE commands generally involve the CONTROL key (sometimes labelledCTRL or CTL) or the META key (generally labelled ESCAPE). Rather thanwrite out META or CONTROL each time we want you to prefix a character,we'll use the following abbreviations: C-<chr> means hold the CONTROL key while typing the character <chr> Thus, C-F would be: hold the CONTROL key and type F. M-<chr> means type the META (ESCAPE) key and release it, then type the character <chr>. The <chr> can be upper or lower case and it will have the same meaning.Important note: if you must exit at some point, type C-X C-C.The characters ">>" at the left margin indicate directions for you totry using a command. For instance:>> Now type C-V (View next screen) to move to the next screen. (go ahead, do it by depressing the control key and V together). From now on, you'll be expected to do this whenever you finish reading the screen.Note that there is an overlap when going from screen to screen; thisprovides some continuity when moving through the file.The first thing that you need to know is how to move around fromplace to place in the file. You already know how to move forward ascreen, with C-V. To move backwards a screen, type M-V (depress theMETA key and type V, or type <ESC>V if you don't have a META or EDITkey).>> Try typing M-V and then C-V to move back and forth a few times.SUMMARY-------The following commands are useful for viewing screenfuls: C-V Move forward one screenful M-V Move backward one screenful C-L Center the current line--clear screen and redisplay everything if current line is already at center. >> find the cursor and remember what text is near it. Then type a C-L. Find the cursor again and see what text is near it now.BASIC CURSOR CONTROL--------------------Getting from screenful to screenful is useful, but how do youreposition yourself within a given screen to a specific place? Thereare several ways you can do this. One way (not the best, but the mostbasic) is to use the commands previous, backward, forward and next.As you can imagine these commands (which are given to JOVE as C-P,C-B, C-F, and C-N respectively) move the cursor from where itcurrently is to a new place in the given direction. Here, in a moregraphical form are the commands: Previous line, C-P : : Backward, C-B .... Current cursor position .... Forward, C-F : : Next line, C-NYou'll probably find it easy to think of these by letter. P forprevious, N for next, B for backward and F for forward. These are thebasic cursor positioning commands and you'll be using them ALL thetime so it would be of great benefit if you learn them now.>> Do a few C-N's to bring the cursor down to this line.>> Move into the line with C-F's and then up with several C-P's. See what C-P does when the cursor is in the middle of the line.Lines are separated by a single Linefeed character, which is what Unixcalls a Newline.>> Try to C-B at the beginning of a line. Do a few more C-B's. Then do C-F's back to the end of the line and beyond.When you go off the top or bottom of the screen, the text beyond theedge is shifted onto the screen so that your instructions can becarried out while keeping the cursor on the screen.>> Try to move the cursor off the bottom of the screen with C-N and see what happens.If moving by characters is too slow, you can move by words. M-F(Meta-F) moves forward a word and M-B moves back a word.>> Type a few M-F's and M-B's. Intersperse them with C-F's and C-B's.Notice the parallel between C-F and C-B on the one hand, and M-F andM-B on the other hand. Very often Meta characters are used foroperations related to English text whereas Control characters operateon the basic textual units that are independent of what you areediting (characters, lines, etc). There is a similar parallel betweenlines and sentences: C-A and C-E move to the beginning or end of aline, and M-A and M-E move to the beginning or end of a sentence.>> Try a couple of C-A's, and then a couple of C-E's. Try a couple of M-A's, and then a couple of M-E's.See how repeated C-A's do nothing, but repeated M-A's keep movingfarther. Do you think that this is right?Two other simple cursor motion commands are M-< (Meta Less-than),which moves to the beginning of the file, and M-> (Meta Greater-than),which moves to the end of the file. You probably don't need to trythem, since finding this spot again will be boring. If you need theshift key to type a "<", then you must also use the shift key to typeM-<. Otherwise, you would be typing M-, .The location of the cursor in the text is also called "point". Toparaphrase, the cursor shows on the screen where point is located inthe text.Here is a summary of simple moving operations including the word andsentence moving commands: C-F Move forward a character C-B Move backward a character M-F Move forward a word M-B Move backward a word C-N Move to next line C-P Move to previous line C-A Move to beginning of line C-E Move to end of line M-A Move back to beginning of sentence M-E Move forward to end of sentence M-< Go to beginning of file M-> Go to end of file>> Try all of these commands now a few times for practice. Since the last two will take you away from this screen, you can come back here with the command C-X C-X (which will be explained later). These are the most often used commands.Like all other commands in JOVE, these commands can be given argumentswhich cause them to be executed repeatedly. The way you give acommand a repeat count is by typing META and then the digits beforeyou type the command. (Remember META is ususally called ESCAPE)For instance, META 8 C-F moves forward eight characters. >> Try giving a suitable argument to C-N or C-P to come as close as you can to this line in one jump.The only apparent exception to this is the screen moving commands, C-Vand M-V. When given an argument, they scroll the screen up or down bythat many lines, rather than screenfuls. This proves to be much moreuseful.>> Try typing M-8 C-V now.Did it scroll the screen up by 8 lines? If you would like to scrollit down you can give an argument to M-V.THE UNIVERSAL ARGUMENT---------------------- Almost every command in JOVE takes a so-called Universal Argument.This argument, although it is interpreted differently in some cases,usually means REPEAT. One important exception to this is with the screenmoving commands. In this case, the number refers to the number of LINESto scroll, not the number of screens. The way you give a command a universal argument is by typing ESC andthen the number. For example, ESC 10 C-F would move you forward tencharacters.>>> Try giving a suitable argument to C-N or C-P to come as close as you can to this line in one jump. Then try giving the same command, except make the number negative. Another count-giving command is C-U. This command, when you first typeit, gives you an argument of 4 (four). If you type C-U C-U, you will getan argument of 16. Each time C-U is typed, the argument is multiplied byfour.>>> Try typing ESC 8 C-V now.THE GOTO COMMAND---------------- Now that we've learned about the universal argument, we can introduceanother cursor positioning command, the command to move to a specificline. This command is given by giving a line number via ESC, and thentyping M-G.>>> Try using the M-< and M-> commands to move to the beginning and the end of the file. Then come back here using the M-G command (this is line 206, so you'd type ESC 206 M-G.)QUITTING FROM COMMANDS----------------------The character in JOVE used to quit out of all commands which requestinput is C-G. For example, you can use C-G to discard a numericargument or the beginning of a command that you don't want to finish.>> Type M-100 to make a numeric arg of 100, then type C-G. Now type C-F. How many characters does it move? If you have typed an <ESC> by mistake, you can get rid of it with a C-G.ERRORS------Sometimes you may do something which JOVE doesn't allow. If it issomething simple, such as typing a control key sequence which is notassociated with any command, JOVE will just beep at you. Otherwise,JOVE will also display an informative error message at the bottom ofthe screen.Some versions of JOVE do not have all the features described in thistutorial implemented yet. If you come across such an unimplementedfeature, you may get an error message when you try to use it. Justproceed on to the next section of the tutorial.INSERTING AND DELETING----------------------If you want to type text, just do it. Characters which you can see,such as A, 7, *, etc. are taken by JOVE as text and insertedimmediately. Type <Return> (the carriage-return key) to insert a lineseparator.You can delete the last character you typed by typing <Delete>.<Delete> is a key on the keyboard, which may be labeled "Rubout"instead of "Delete" on some terminals. More generally, <Delete>deletes the character immediately before the current cursor position.>> Do this now, type a few characters and then delete them by typing <Delete> a few times. Don't worry about this file being changed; you won't affect the master tutorial. This is just a copy of it.>> Now start typing text until you reach the right margin, and keep typing. When a line of text gets too big for one line on the screen, the line of text is "continued" off the edge of the screen The exclamation mark at the right margin indicates a line which has been continued. The line will slide over if you move off the edge on either side.>> The following line actually goes off the edge. Trying typing enough 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.>> Use <Delete>s to delete the text until the line fits on one screen line again. The continuation "!" will go away.>> Move the cursor to the beginning of a line and type <Delete>. This deletes the line separator before the line and merges the line onto the previous line. The resulting line may be too long to fit, in which case it has a continuation indication.>> Type <Return> to insert the separator again.Remember that most JOVE commands can be given a repeat count; Notethat this includes characters which insert themselves.>> Try that now -- type META 8 * and see what happens.If you want to create a blank line in between two lines, move to thesecond of the two lines and type C-O.>> Try moving to a line and typing C-O now.You've now learned the most basic way of typing something in JOVE andcorrecting errors. You can delete by words or lines as well. Here isa summary of the delete operations: <Delete> delete the character just before the cursor C-D delete the next character after the cursor M-<Delete> kill the word immediately before the cursor M-D kill the next word after the cursor C-K kill from the cursor position to end of line M-K kill to the end of the current sentenceNotice that <Delete> and C-D vs M-<Delete> and M-D extend the parallelstarted by C-F and M-F (well, <Delete> isn't really a controlcharacter, but let's not worry about that). C-K and M-K are like C-Eand M-E, sort of, in that lines are opposite sentences.Now suppose you kill something, and then you decide that you want toget it back? Well, whenever you kill something bigger than a
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -