⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutorial

📁 windows版本的emacs
💻
📖 第 1 页 / 共 4 页
字号:
which contains the cursor, to occupy the full screen.  It deletes allother windows.>> Move the cursor to this line and type C-u 0 C-l.>> Type CONTROL-h k CONTROL-f.   See how this window shrinks, while a new one appears   to display documentation on the CONTROL-f command.>> Type C-x 1 and see the documentation listing window disappear.This command is unlike the other commands you have learned in that itconsists of two characters.  It starts with the character CONTROL-x.There is a whole series of commands that start with CONTROL-x; many ofthem have to do with windows, files, buffers, and related things.These commands are two, three or four characters long.* INSERTING AND DELETING------------------------If you want to insert text, just type the text.  Characters which youcan see, such as A, 7, *, etc. are taken by Emacs as text and insertedimmediately.  Type <Return> (the carriage-return key) to insert aNewline character.You can delete the last character you typed by typing <Delback>.<Delback> is a key on the keyboard--the same one you normally use,outside Emacs, for deleting the last character you typed.  It isnormally a large key a couple of lines up from the <Return> key, andit is usually labeled "Delete", "Del" or "Backspace".If the large key there is labeled "Backspace", then that's the one youuse for <Delback>.  There may also be another key labeled "Delete"somewhere else, but that's not <Delback>.More generally, <Delback> deletes the character immediately before thecurrent cursor position.>> Do this now--type a few characters, then delete them   by typing <Delback> a few times.  Don't worry about this file   being changed; you will not alter the master tutorial.  This is   your personal copy of it.When a line of text gets too big for one line on the screen, the lineof text is "continued" onto a second screen line.  A backslash ("\")(or, if you're using a windowed display, a little curved arrow) at theright margin indicates a line which has been continued.>> Insert text until you reach the right margin, and keep on inserting.   You'll see a continuation line appear.>> Use <Delback>s to delete the text until the line fits on one screen   line again.  The continuation line goes away.You can delete a Newline character just like any other character.Deleting the Newline character between two lines merges them intoone line.  If the resulting combined line is too long to fit in thescreen width, it will be displayed with a continuation line.>> Move the cursor to the beginning of a line and type <Delback>.  This   merges that line with the previous line.>> Type <Return> to reinsert the Newline you deleted.Remember that most Emacs commands can be given a repeat count;this includes text characters.  Repeating a text character insertsit several times.>>  Try that now -- type C-u 8 * to insert ********.You've now learned the most basic way of typing something inEmacs and correcting errors.  You can delete by words or linesas well.  Here is a summary of the delete operations:	<Delback>    delete the character just before the cursor	C-d   	     delete the next character after the cursor	M-<Delback>  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 <Delback> and C-d vs M-<Delback> and M-d extend the parallelstarted by C-f and M-f (well, <Delback> is not 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.You can also kill any part of the buffer with one uniform method.Move to one end of that part, and type C-@ or C-SPC (either one).(SPC is the Space bar.)  Move to the other end of that part, and typeC-w.  That kills all the text between the two positions.>> Move the cursor to the Y at the start of the previous paragraph.>> Type C-SPC.  Emacs should display a message "Mark set"   at the bottom of the screen.>> Move the cursor to the n in "end", on the second line of the   paragraph.>> Type C-w.  This will kill the text starting from the Y,   and ending just before the n.The difference between "killing" and "deleting" is that "killed" textcan be reinserted, whereas "deleted" things cannot be reinserted.Reinsertion of killed text is called "yanking".  Generally, thecommands that can remove a lot of text kill the text (they set up sothat you can yank the text), while the commands that remove just onecharacter, or only remove blank lines and spaces, do deletion (so youcannot yank that text).>> Move the cursor to the  beginning of a line which is not empty.   Then type C-k to kill the text on that line.>> Type C-k a second time.  You'll see that it kills the Newline   which follows that line.Note that a single C-k kills the contents of the line, and a secondC-k kills the line itself, and makes all the other lines move up.  C-ktreats a numeric argument specially: it kills that many lines ANDtheir contents.  This is not mere repetition.  C-u 2 C-k kills twolines and their newlines; typing C-k twice would not do that.Bringing back killed text is called "yanking".  (Think of it asyanking back, or pulling back, some text that was taken away.)  Youcan yank the killed text either at the same place where it was killed,or at some other place in the buffer, or even in a different file.You can yank the same text several times; that makes multiple copiesof it.The command for yanking is C-y.  It reinserts the last killed text,at the current cursor position.>> Try it; type C-y to yank the text back.If you do several C-k's in a row, all of the killed text is savedtogether, so that one C-y will yank all of the lines at once.>> 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 do not have to do anything tokeep it.  Just go on with your editing, leaving the yanked text whereit is.If you M-y enough times, you come back to the starting point (the mostrecent 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.* UNDO------If you make a change to the text, and then decide that it was amistake, you can undo the change with the undo command, C-x u.Normally, C-x u undoes the changes made by one command; if you repeatthe C-x u several times in a row, each repetition undoes oneadditional command.But there are two exceptions: commands that do not change the text donot count (this includes cursor motion commands and scrollingcommand), and self-inserting characters are usually handled in groupsof up to 20.  (This is to reduce the number of C-x u's you have totype to undo insertion of text.)>> Kill this line with C-k, then type C-x u and it should reappear.C-_ is an alternative undo command; it works just the same as C-x u,but it is easier to type several times in a row.  The disadvantage ofC-_ is that on some keyboards it is not obvious how to type it.  Thatis why we provide C-x u as well.  On some terminals, you can type C-_by typing / while holding down CONTROL.A numeric argument to C-_ or C-x u acts as a repeat count.You can undo deletion of text just as you can undo killing of text.The distinction between killing something and deleting it affectswhether you can yank it with C-y; it makes no difference for undo.* 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 Emacs goesaway.  In order to put your text in a file, you must "find" the filebefore you enter the text.  (This is also called "visiting" the file.)Finding a file means that you see the contents of the file withinEmacs.  In many ways, it is as if you were editing the file itself.However, the changes you make using Emacs do not become permanentuntil you "save" the file.  This is so you can avoid leaving ahalf-changed file on the system when you do not want to.  Even whenyou save, Emacs leaves the original file under a changed name in caseyou later decide that your changes were a mistake.If you look near the bottom of the screen you will see a line thatbegins and ends with dashes, and starts with "--:-- TUTORIAL" orsomething like that.  This part of the screen normally shows the nameof the file that you are visiting.  Right now, you are visiting a filecalled "TUTORIAL" which is your personal scratch copy of the Emacstutorial.  When you find a file with Emacs, that file's name willappear in that precise spot.One special thing about the command for finding a file is that youhave to say what file name you want.  We say the command "reads anargument from the terminal" (in this case, the argument is the name ofthe file).  After you type the command	C-x C-f   Find a fileEmacs asks you to type the file name.  The file name you type appearson the bottom line of the screen.  The bottom line is called theminibuffer when it is used for this sort of input.  You can useordinary Emacs editing commands to edit the file name.While you are entering the file name (or any minibuffer input),you can cancel the command with C-g.>> Type C-x C-f, then type C-g.  This cancels the minibuffer,   and also cancels the C-x C-f command that was using the   minibuffer.  So you do not find any file.When you have finished entering the file name, type <Return> toterminate it.  Then C-x C-f command goes to work, and finds the fileyou chose.  The minibuffer disappears when the C-x C-f command isfinished.In a little while the file contents appear on the screen, and you canedit the contents.  When you wish to make your changes permanent,type the command	C-x C-s   Save the fileThis copies the text within Emacs into the file.  The first time youdo this, Emacs renames the original file to a new name so that it isnot lost.  The new name is made by adding "~" to the end of theoriginal file's name.When saving is finished, Emacs displays the name of the file written.You should save fairly often, so that you will not lose very muchwork if the system should crash.>> Type C-x C-s, saving your copy of the tutorial.   This should show "Wrote ...TUTORIAL" at the bottom of the screen.NOTE: On some systems, typing C-x C-s will freeze the screen and youwill see no further output from Emacs.  This indicates that anoperating system "feature" called "flow control" is intercepting theC-s and not letting it get through to Emacs.  To unfreeze the screen,type C-q.  Then see the section "Spontaneous Entry to IncrementalSearch" in the Emacs manual for advice on dealing with this "feature".You can find an existing file, to view it or edit it.  You can alsofind a file which does not already exist.  This is the way to create afile with Emacs: find the file, which will start out empty, and thenbegin inserting the text for the file.  When you ask to "save" thefile, Emacs will really create the file with the text that you haveinserted.  From then on, you can consider yourself to be editing analready existing file.* BUFFERS---------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -