📄 teach-jove
字号:
character, JOVE saves it for you. To yank it back, use C-Y. Notethat you don't have to be in the same place to do C-Y; This is a goodway to move text around. Also note that the difference between"Killing" and "Deleting" something is that "Killed" things can beyanked back, and "Deleted" things cannot. Generally, the commandsthat can destroy a lot of text save it, while the ones that attackonly one character, or nothing but blank lines and spaces, do not save.For instance, type C-N a couple times to postion the cursor at someline on this screen.>> Do this now, move the cursor and kill that line with C-K.Note that a single C-K kills the contents of the line, and a secondC-K kills the line itself, and make all the other lines move up. Ifyou give C-K a repeat count, it kills that many lines AND theircontents.The text that has just disappeared is saved so that you can retrieveit. To retrieve the last killed text and put it where the cursorcurrently is, type C-Y.>> Try it; type C-Y to yank the text back.Think of C-Y as if you were yanking something back that someone tookaway from you. Notice that if you do several C-K's in a row the textthat is killed is all saved together so that one C-Y will yank all ofthe lines.>> Do this now, type C-K several times.Now to retrieve that killed text:>> Type C-Y. Then move the cursor down a few lines and type C-Y again. You now see how to copy some text.What do you do if you have some text you want to yank back, and thenyou kill something else? C-Y would yank the more recent kill. Butthe previous text is not lost. You can get back to it using the M-Ycommand. After you have done C-Y to get the most recent kill, typingM-Y replaces that yanked text with the previous kill. Typing M-Yagain and again brings in earlier and earlier kills. When you havereached the text you are looking for, you can just go away and leaveit there. If you M-Y enough times, you come back to the startingpoint (the most recent kill).>> Kill a line, move around, kill another line. Then do C-Y to get back the second killed line. Then do M-Y and it will be replaced by the first killed line. Do more M-Y's and see what you get. Keep doing them until the second kill line comes back, and then a few more. If you like, you can try giving M-Y positive and negative arguments.FILES-----In order to make the text you edit permanent, you must put it in afile. Otherwise, it will go away when your invocation of JOVE goesaway. While you are editing a file in JOVE, your changes are actuallybeing made to a private "scratch" copy of the file. However, thechanges still don't become permanent until you "save" the file. Thisis so you can have control to avoid leaving a half-changed file aroundwhen you don't want to.If you look near the botton of the screen you will see a line thatlooks like this: JOVE (Text) Buffer: teach-jove "teach-jove" *"teach-jove" is the name of the file you are editing. This is the nameof your own temporary copy of the text of the JOVE tutorial; the fileyou are now editing. Whatever file you edit, that file's name willappear in that precise spot.The commands for finding and saving files are unlike the othercommands you have learned in that they consist of two characters.They both start with the character Control-X. There is a whole seriesof commands that start with Control-X; many of them have to do withfiles, buffers, and related things, and all of them consist ofControl-X followed by some other character. As with M- the characterinterpreted the same regardless of case.Another thing about the command for finding a file is that you have tosay what file name you want. We say the command "reads an argumentfrom the terminal" (in this case, the argument is the name of thefile). After you type the command C-X C-F Find a fileJOVE will ask you for the file name. You should end the name withthe Return key. After this command, you will see the contents of thefile in your JOVE. You can edit the contents. When you wish to makethe changes permanent, issue the command C-X C-S Save the fileWarning: on many systems JOVE will not be able to process the key C-S.In place of C-S, you should type C-\. It is possible to make C-S workbut C-\ is guaranteed always to work in place of C-S.The old version of the file will be replaced. When the operation isfinished, JOVE prints the name and number of lines and characterssaved.If you forget to save and then edit a different file, JOVE will remindyou that you made changes that have not been saved and then ask youwhether you really want to quit. (If you don't save them, they willbe thrown away. That might be what you want!) You should answer witha "Y" to throw the changes away or "N" to abort quitting so you canthen save the changes.To make a new file, just edit it "as if" it already existed. Thenstart typing in the text. When you ask to "save" the file, JOVE willreally create the file with the text that you have inserted. Fromthen on, you can consider yourself to be editing an already existingfile.It is not easy for you to try out editing a file and continue with thetutorial. But you can always come back into the tutorial by startingit over and skipping forward. So, when you feel ready, you should tryediting a file named "FOO", putting some text in it, and saving it;then exit from JOVE and look at the file to be sure that it worked.CONCLUSION OF PART ONE---------------------- This is the end of the first part of this tutorial. You now knowenough to edit a file with JOVE, and save your work. The second part ofthis tutorial, which starts with the next section, discusses searching,replacing, word processing, and other modes of JOVE. You may wish tostop here and practice for awhile before you continue.EXTENDING THE COMMAND SET-------------------------There are many, many more JOVE commands than could possibly be put onall the control and meta characters. JOVE gets around this with the X(eXtend) command. This comes in two flavors: C-X Character eXtend. Followed by one character. M-X Named command eXtend. Followed by a long name.These are commands that are generally useful but used less than thecommands you have already learned about. You have already seen two ofthem: the file commands C-X C-F to Find and C-X C-S to Save. Anotherexample is the command to tell JOVE that you'd like to stop editing.The command to do this is C-X C-C.There are many C-X commands. The ones you need immediately are: C-X C-V Visit file. C-X C-S Save file. C-X C-C Quit JOVE. This does not save your files auto- matically, though if your files have been modi- fied, JOVE asks if you really want to quit. The standard way to save and exit is C-X C-S C-X C-C.Named eXtended commands are commands which are used even lessfrequently, or commands which are used only in certain modes. Thesecommands are usually called "commands". An example is the command"apropos", which prompts for a keyword and then gives the names of allthe commands that apropos for that keyword. When you type M-X, JOVEprompts you at the bottom of the screen with ":" and you should typethe name of the command you wish to call; in this case, "apropos".Just type "apr<Space>" and JOVE will complete the name. JOVE will askyou for a keyword or phrase and you type the string that you want askabout.>> Try typing M-X, followed by "apropos" or "apr" and then Return. Then try typing "file" followed by a Return.MODE LINE---------If JOVE sees that you are typing commands slowly it shows them to youat the bottom of the screen in an area called the echo area. The echoarea contains the bottom line of the screen. The line immediately abovethem is called the MODE LINE. The mode line says something like JOVE (Text) Buffer: [buffername] "filename" *This is a very useful "information" line.The buffername is the name JOVE gave to the buffer, and it is usuallyrelated to the filename. You already know what the filename means --it is the file you have edited.The star means that you have made changes to the text. Right afteryou visit or save a file, there is no star.The part of the mode line inside the parentheses is to tell you whatmodes you are in. The default mode is Text which is what you are innow. It is an example of a "major mode". There are several majormodes in JOVE for editing different languages and text, such as Cmode, Lisp mode, Text mode, etc. At any time one and only one majormode is active, and its two-letter code can always be found in themode line just where "Text" is now. Each major mode makes a fewcommands behave differently. For example, what JOVE considers as partof a valid expression or an identifier differs from one major mode toanother, since each programming language has a different idea of whatis a legal identifier.Major modes are called major because there are also minor modes. Theyare called minor because they aren't alternatives to the major modes,just minor modifications of them. Each minor mode can be turned on oroff by itself, regardless of what major mode you are in, andregardless of the other minor modes. So you can use no minor modes,or one minor mode, or any combination of several minor modes.One minor mode which is very useful, especially for editing Englishtext, is "Auto Fill" mode. When this mode is on, JOVE breaks the linein between words automatically whenever the line gets too long. Youcan turn this mode on by doing M-X auto-fill-mode<Return>. When themode is on, you can turn it off by doing M-X auto-fill-mode<Return>--it toggles.>> Type "M-X auto-fill-mode<Return>" now. Then insert a line with a bunch of words over again until you see it divide into two lines. You must put in spaces between them because Auto Fill breaks lines only at spaces. Notice that "Fill" (the code for Auto Fill) appears in the mode line after "Text" to indicate that you are in Text Fill mode.The margin is usually set at 78 characters, but you can change it withthe set command. The margin is kept in a variable just like the modevalues.>> Type "M-X set right-margin 20", then type in some text and see JOVE fill lines of 20 characters with it. Then set the margin back to 72 using M-X set again.SEARCHING---------JOVE can do searches for strings (these are groups of contiguouscharacters or words) either forward through the file or backwardthrough it. To search for the string means that you are trying tofind that string somewhere in the file. Remember to use C-\ where itsays C-S.>> Now type C-S to start a search. Type the word 'cursor', then Return.>> Type C-S Return to find the next occurrence of "cursor".The C-S starts a search that looks for any occurrence of the searchstring AFTER the current cursor position. But what if you want tosearch for something earlier in the text? To do this one should typeC-R for reverse search. Everything that applies to C-S applies to C-Rexcept that the direction of the search is reversed.REPLACING TEXT-------------->> Move the cursor to the blank line two lines below this one. Then type M-r changed<Return>altered<Return>. Notice how this line has changed: you've replaced the word c-h-a-n-g-e-d with "altered" wherever it occurs after the cursor.The more customary command for replacing strings is the interactivecommand query-replace-search, which has several options. In essence,it shows each occurrence of the first string and asks you if you want toreplace it or not. You can also choose to edit around the string, orgo on and replace all occurrences without asking further. This is invoked with M-Q.. When you start up a Query Replace, itwill prompt you with "From" and "To", for what you want to change, andwhat you want to change it to. JOVE will then move to the firstoccurence of the "From", and wait for a character. You can type: <SPACE> Do the replacement, and move to next occurrence of the "From" string. <DEL> Skip the current "From" string and move to the next one. RETURN Exit the Query Replace now. r Recursive Edit p Replace all further occurences of the "From" string, without asking. Recursive edit makes it possible to temporarily supend the Q-R-S, let theuser go off and do something, and then return to the search after the heis done. The command exit-jove (C-X C-C) returns from the recursive-edit.GETTING MORE HELP-----------------In this tutorial we have tried to supply just enough information toget you started using JOVE. There is so much available in JOVE thatit would be impossible to explain it all here. However, you may wantto learn more about JOVE since it has numerous desirable features thatyou don't know about yet. JOVE has a some internal documentation.The most basic HELP feature is the describe-key command which isavailable by typing C-X ? and then a command character. JOVE printsone line line on the bottom of the screen tell what command is bound tothat key. You can then get further information on that commandusing...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -