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

📄 tutorial

📁 早期freebsd实现
💻
📖 第 1 页 / 共 3 页
字号:
Copyright (c) 1985 Free Software Foundation, Inc;  See end for conditions.You are looking at the Emacs tutorial.Emacs commands generally involve the CONTROL key (sometimes labelledCTRL or CTL) or the META key (sometimes labelled EDIT).  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 hold the META or EDIT key down while typing <chr>.	  If there is no META or EDIT key, type <ESC>, release it,	  then type the character <chr>.  "<ESC>" stands for the	  key labelled "ALT" or "ESC".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 here by startup of help-with-tutorial>>>>  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	Clear screen and redisplay everything		 putting the text near the cursor at the center.		 (That's control-L, not control-1.		  There is no such character as control-1.)>> 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?There are several ways you can do this.  One way (not the best, butthe most basic) is to use the commands previous, backward, forwardand next.  As you can imagine these commands (which are given toEmacs as C-p, C-b, C-f, and C-n  respectively) move the cursor fromwhere it currently is to a new place in the given direction.  Here,in a more graphical form are the commands: 			  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   and type C-l to see the whole diagram centered in the screen.You'll probably find it easy to think of these by letter.  P forprevious, N for next, B for backward and F for forward.  These arethe basic cursor positioning commands and you'll be using them ALLthe time 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 C-p's.   See what C-p does when the cursor is in the middle of the line.Lines are separated by Newline characters.  For most applicationsthere should normally be a Newline character at the end of the text,as well, but it is up to you to make sure of this.  A file canvalidly exist without a Newline at the end.>> 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 beyondthe edge is shifted onto the screen so that your instructions canbe carried 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.  On most terminalsthe "<" is above the comma and you must use the shift key to type it.On these terminals you must use the shift key to type M-< also;without the shift key, you would be typing M-comma.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 M-v's and C-v's.  These are   the most often used commands.Like all other commands in Emacs, these commands can be givenarguments which cause them to be executed repeatedly.  The way yougive a command a repeat count is by typing C-u and then the digitsbefore you type the command.  If you have a META or EDIT key, you canomit the C-u if you hold down the META or EDIT key while you type thedigits.  This is easier, but we recommend the C-u method because itworks on any terminal.For instance, C-u 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-v and M-v.  When given an argument, they scroll the screen up ordown by that many lines, rather than screenfuls.  This proves to bemuch more useful.>> Try typing C-u 8 C-v now.Did it scroll the screen up by 8 lines?  If you would like toscroll it down you can give an argument to M-v.WHEN EMACS IS HUNG-----------------If Emacs gets into an infinite (or simply very long) computation whichyou don't want to finish, you can stop it safely by typing C-g.You can also use C-g to discard a numeric argument or the beginning ofa command that you don't want to finish.>> Type C-u 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.If you type <ESC> <ESC>, you get a new window appearing onthe screen, telling you that M-ESC is a "disabled command"and asking whether you really want to execute it.  The commandM-ESC is marked as disabled because you probably don't want touse it until you know more about Emacs, and we expect it wouldconfuse you if it were allowed to go ahead and run.  If you reallywant to try the M-ESC command, you could type a Space in answerto the question and M-ESC would go ahead.  Normally, if you donot want to execute M-ESC, you would type "n" to answer the question.>> Type <ESC> <ESC>, then type n.WINDOWS-------Emacs can have several windows, each displaying its own text.At this stage it is better not to go into the techniques ofusing multiple windows.  But you do need to know how to getrid of extra windows that may appear to display help oroutput from certain commands.  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 makes the window which the cursor is in becomethe full screen, by getting rid of any other 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.INSERTING AND DELETING----------------------If you want to insert text, just type it.  Characters which you cansee, 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 <Rubout>.<Rubout> is a key on the keyboard, which might be labelled "Delete"instead of "Rubout" on some terminals.  More generally, <Rubout>deletes the character immediately before the current cursor position.>> Do this now, type a few characters and then delete them   by typing <Rubout> 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" onto a second screen line.   The backslash at the right margin indicates a line which has   been continued.>> Use <Rubout>s to delete the text until the line fits on one screen   line again.  The continuation line goes away.>> Move the cursor to the beginning of a line and type <Rubout>.  This   deletes the newline 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 line.>> Type <Return> to reinsert the Newline you deleted.Remember that most Emacs commands can be given a repeat count;this includes characters which insert themselves.>>  Try that now -- type C-u 8 * and see what happens.

⌨️ 快捷键说明

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