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

📄 tutorial

📁 windows版本的emacs
💻
📖 第 1 页 / 共 4 页
字号:
You are looking at the Emacs tutorial.  See end for copying conditions.Copyright (c) 1985, 1996, 1998, 2001, 2002 Free Software Foundation.Emacs commands generally involve the CONTROL key (sometimes labeledCTRL or CTL) or the META key (sometimes labeled EDIT or ALT).  Rather thanwrite that in full each time, 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 hold the META or EDIT or ALT key down while typing <chr>.	  If there is no META, EDIT or ALT key, instead press and release the	  ESC key and then type <chr>.  We write <ESC> for the ESC key.Important note: to end the Emacs session, type C-x C-c.  (Two characters.)The characters ">>" at the left margin indicate directions for you totry using a command.  For instance:<<Blank lines inserted around following line by help-with-tutorial>>[Middle of page left blank for didactic purposes.   Text continues below]>>  Now type C-v (View next screen) to move to the next screen.	(go ahead, do it by holding down the CONTROL key while typing v).	From now on, you should do this again whenever you finish	reading the screen.Note that there is an overlap of two lines when you move from screento screen; this provides some continuity so you can continue readingthe text.The first thing that you need to know is how to move around from placeto place in the text.  You already know how to move forward one screen,with C-v.  To move backwards one screen, type M-v (hold down the META keyand type v, or type <ESC>v if you do not have a META, EDIT, or ALT key).>>  Try typing M-v and then C-v, 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	Clear screen and redisplay all the text,		 moving the text around the cursor		 to the center of the screen.		 (That's CONTROL-L, not CONTROL-1.)>> Find the cursor, and note what text is near it.   Then type C-l.   Find the cursor again and notice that the same text   is near the cursor now.You can also use the PageUp and PageDn keys to move by screenfuls, ifyour terminal has them, but you can edit more efficiently if you useC-v and M-v.* BASIC CURSOR CONTROL----------------------Moving from screenful to screenful is useful, but how do youmove to a specific place within the text on the screen?There are several ways you can do this.  You can use the arrow keys,but it's more efficient to keep your hands in the standard positionand use the commands C-p, C-b, C-f, and C-n.  These charactersare equivalent to the four arrow keys, like this: 			  Previous line, C-p				  :				  :   Backward, C-b .... Current cursor position .... Forward, C-f				  :				  :			    Next line, C-n>> Move the cursor to the line in the middle of that diagram   using C-n or C-p.  Then type C-l to see the whole diagram   centered in the screen.You'll find it easy to remember these letters by words they stand for:P for previous, N for next, B for backward and F for forward.  Youwill be using these basic cursor positioning commands all the time.>> 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 C-p's.   See what C-p does when the cursor is in the middle of the line.Each line of text ends with a Newline character, which serves toseparate it from the following line.  The last line in your file oughtto have a Newline at the end (but Emacs does not require it to haveone).>> Try to C-b at the beginning of a line.  It should move to   the end of the previous line.  This is because it moves back   across the Newline character.C-f can move across a Newline just like C-b.>> Do a few more C-b's, so you get a feel for where the cursor is.   Then do C-f's to return to the end of the line.   Then do one more C-f to move to the following line.When you move past the top or bottom of the screen, the text beyondthe edge shifts onto the screen.  This is called "scrolling".  Itenables Emacs to move the cursor to the specified place in the textwithout moving it off 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.When you are in the middle of a word, M-f moves to the end of the word.When you are in whitespace between words, M-f moves to the end of thefollowing word.  M-b works likewise in the opposite direction.>> Type M-f and M-b a few times, interspersed with C-f's and C-b's   so that you can observe the action of M-f and M-b from various   places inside and between words.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 the units defined by language (words, sentences,paragraphs), while Control characters operate on basic units that areindependent of what you are editing (characters, lines, etc).This parallel applies between lines and sentences: C-a and C-e move tothe beginning or end of a line, and M-a and M-e move to the beginningor 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 moving onemore sentence.  Although these are not quite analogous, each one seemsnatural.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 cursor-moving operations, including theword and sentence 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>> Try all of these commands now a few times for practice.   These are the most often used commands.Two other important cursor motion commands are M-< (META Less-than),which moves to the beginning of the whole text, and M-> (METAGreater-than), which moves to the end of the whole text.On most terminals, the "<" is above the comma, so you must use theshift key to type it.  On these terminals you must use the shift keyto type M-< also; without the shift key, you would be typing M-comma.>> Try M-< now, to move to the beginning of the tutorial.   Then use C-v repeatedly to move back here.>> Try M-> now, to move to the end of the tutorial.   Then use M-v repeatedly to move back here.You can also move the cursor with the arrow keys, if your terminal hasarrow keys.  We recommend learning C-b, C-f, C-n and C-p for threereasons.  First, they work on all kinds of terminals.  Second, onceyou gain practice at using Emacs, you will find that typing these Controlcharacters is faster than typing the arrow keys (because you do nothave to move your hands away from touch-typing position).  Third, onceyou form the habit of using these Control character commands, you caneasily learn to use other advanced cursor motion commands as well.Most Emacs commands accept a numeric argument; for most commands, thisserves as a repeat-count.  The way you give a command a repeat countis by typing C-u and then the digits before you type the command.  Ifyou have a META (or EDIT or ALT) key, there is another, alternative wayto enter a numeric argument: type the digits while holding down theMETA key.  We recommend learning the C-u method because it works onany terminal.  The numeric argument is also called a "prefix argument",because you type the argument before the command it applies to.For instance, C-u 8 C-f moves forward eight characters.	>> Try using C-n or C-p with a numeric argument, to move the cursor   to a line near this one with just one command.Most commands use the numeric argument as a repeat count, but somecommands use it in some other way.  Several commands (but none ofthose you have learned so far) use it as a flag--the presence of aprefix argument, regardless of its value, makes the command dosomething different.C-v and M-v are another kind of exception.  When given an argument,they scroll the screen up or down by that many lines, rather than by ascreenful.  For example, C-u 8 C-v scrolls the screen by 8 lines.>> Try typing C-u 8 C-v now.This should have scrolled the screen up by 8 lines.  If you would liketo scroll it down again, you can give an argument to M-v.If you are using a windowed display, such as X11 or MS-Windows, thereshould be a tall rectangular area called a scroll bar at the left handside of the Emacs window.  You can scroll the text by clicking themouse in the scroll bar.>> Try pressing the middle button at the top of the highlighted area   within the scroll bar.  This should scroll the text to a position   determined by how high or low you click.>> Try moving the mouse up and down, while holding the middle button   pressed down.  You'll see that the text scrolls up and down as   you move the mouse.* WHEN EMACS IS HUNG--------------------If Emacs stops responding to your commands, you can stop it safely bytyping C-g.  You can use C-g to stop a command which is taking toolong to execute.You can also use C-g to discard a numeric argument or the beginning ofa command that you do not want to finish.>> Type C-u 100 to make a numeric arg of 100, then type C-g.   Now type C-f.  It should move just one character,   because you canceled the argument with C-g.If you have typed an <ESC> by mistake, you can get rid of itwith a C-g.* DISABLED COMMANDS-------------------Some Emacs commands are "disabled" so that beginning users cannot usethem by accident.If you type one of the disabled commands, Emacs displays a messagesaying what the command was, and asking you whether you want to goahead and execute the command.If you really want to try the command, type Space in answer to thequestion.  Normally, if you do not want to execute the disabledcommand, answer the question with "n".>> Type C-x C-l (which is a disabled command),   then type n to answer the question.* WINDOWS---------Emacs can have several windows, each displaying its own text.  We willexplain later on how to use multiple windows.  Right now we want toexplain how to get rid of extra windows and go back to basicone-window editing.  It is simple:	C-x 1	One window (i.e., kill all other windows).That is CONTROL-x followed by the digit 1.  C-x 1 expands the window

⌨️ 快捷键说明

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