Emacs command set

zhaozj2021-02-12  148

Emacs Start: Direct Emacs, if you have X-Windows will open the window. If you don't want to use X, you will start with Emacs -nw (no windows). Symbol Description CX means holding down the Ctrl key, then press X, then Ctrl, X is released together. MX Meta Meta On the computer without META keys, MX is equal to pressing the ESC button first, then press the X key. The Meta button on the Sun is the key of the rhombus. Some system META keys are Alt keys. (Or Alt key on a certain side) CX or MX x is not caseped separately. The Emacs button command is basically a string C- and m-. More than two button commands, Emacs will be on the screen The bottom line shows what you pressed. This line is called MINI Buffer End Emacs Press CX CC to cancel the CG Some emacs commands will run for a long time, and can be interrupted by CG. Pressing the error button to cancel it. Move CP up and down CP Previous Line) No CF Down (Forward) CB to Left (Backward) In fact, Emacs is internally unbalanced, put an article in a big buffer, so cf (forward) is Moving, CB (Backward) is the meaning of moving back, one word. Turn the next page CV (View Next Screen) When the MV is turned on, the last place will stay at the top of the screen at the end of the screen Continuity. Emacs will automatically skip halfpage at the bottom of the cursor close to the screen, and move the file forward, easy to read. Significantly read the special name of the cursor inside the screen CL Emacs called Point. Point == Cursor Current Code Jumping a word MF to jump MB Note CF with MF, CB and MB symmetry. Move to the line CA line CE moved to the sentence MA to the tail Me (MA to the last period of time, one sentence The beginning. ME to the period) Move to the pension M- Delete the cursor currently refers to the word CD The front word Del (Delete Key) Del is called Rubout (Rub out) M-DEL Removes a word (Word) MD Removing (Back of the Cursor) CK Delete (KILL) MK Delete one sentence (Deleted Start) (Kill) Note Backspace =

CH is HELP's meaning after EMACS, which means that this deleted action is Kill, not equally equal to Delete. Emacs will put Kill Ring to Kill Ring, is a temporary place, afterwards You can call it. See YANK instructions. Undo: CX U c-_ _ equals CX u Some DEC terminals, C- / is c-_ _ Sometimes equal to C-Shift- - Repeat Executation Example, shift 8 words to right, Cu 8 CF CU is quite special in Emacs, used to set some of the quotes (Argument / Repeat count) to future commands. Cu 2 0 CN moves down 20 rows There is a special exception, Cu 3 CV is not turning three pages But the entire screen is shifted up. It is said that this is meaningful. Cu 1 0 CX u Undo 10 times to CL a quoter: Cu 0 Cl will redraw the screen, and move the current row to the screen OK. In addition, Cu 100 is equal to M-100 Cu numbers equal to M-digital X Windows, C-LEFT C-Right moves one word (Word). C-Up C-Down moves (paragraphs / C language is Block Home = ca end = ce c-home = m- pgup pgdn = MV CV settings are more simple, such as 10 words to be removed to right C-1 C-0 Right- Arrow is holding down Ctrl, then hits 10, it is simpler than the CU 1 0. Mouse is used to select Hi-Light. Right-click Menu-Button If you accidentally press ESC, equal to M-ESC, There will be a message to run out, you press a disabled command. This is a senior directive, the author thinks that beginners don't use it, so I will ask you to start it, general answer no. If a one is too long, the screen is displayed No, Emacs will play $ right at the right side of the screen, indicating that the line is not finished, and the right side is removed to be two lines: I want to press Enter. Merge two lines: Press CD at the distance (or line) First press DEL) YANK: Spit out of deleted ( Killed) Things. Just delete it with Kill (CK, MK, etc.), more than one word, Emacs will put it it, then CY can call it. The function is the same as CUT & Paste. Kill and Delete are different, Only by Kill can be used to spit back. The cursor is in the same place. The information that the continuous KILL will be lost as a kill, YANK will come back together. The information dropped by Kill Ring is called Kill Ring. The structure is above, Ring is a circle, and the things dropped by Kill will be placed on the circle. YANK will put back the most recent KILL. If you want, you can change it. (My is telling it. " Emacs, wrong, I don't want this one, exchange for me). My is following the CY. Copying the text method == Continuous CK a few times, delete the row to copy, then press CY to get back To the place where I want to copy, I will become. The information you want to copy will fall. Kill is very stupid. It is a more civilized method, that is, MW, but more troublesome. First, Mark set with C-SPC or C- @. However, move the cursor to the other, press MW to save the words between the Mark to Point to Kill Ring. Point is the meaning of the cursor. Emacs will not take Mark The place is represented by highlight unless it is in X. Under X, you can use MW to copy the text with a mouse. Kill & YANK is CUT &

Paste's meaning. Most of the above commands are also valid for the Bash command. Read files: Emacs Terminology is finding a file. CX CF is then entered in Mini-Buffer. When entering the file, the SPC key has auto- Complete features, or show a few words in front of the dynasty and input until the file is now, (Tab "also has a similar function) CX CF called Find-File CX CS archive (SAVE CURRENT FILE, SAVE CURRENT BUFFER) CX S The file CX i is inserted into the file to read the contents of the additional files. In the current editing area, the window Emacs reads the file. There is buffer. We look through the window / edit buffer. Two window will cut the screen into two parts. They can display the same, or different files at the same time. For beginners, what is the most needed is how to let the unwanted window disappear: CX 0 Turn off the current window CX 1 will make the current window account for the whole ONE Window, cancel / turn off other windows. There are many functions in Emacs to open a small window to communicate, display the message. Sometimes it is very annoying, CX 1 is very useful. Another How is the function jumps to another window. CX O (Other-window) CX 2 cuts the current window into two (horizontal segmentation) CX 3 (vertical segmentation) CX 4 is a string of instructions related to the window. CX 4 is A string of instructions related to the window. CX 5 is extended to X -ty-x window, called Frame. CX 5 2 is another X Window (Frame). Multi-file editing CX CB sees now there are more buffers (buffer Emacs) The place where the file is released). CX B and then enter the name of the buffer in Minibuffer. You can switch the editing of the buffer. Tab button also works. Some internal buffers (there is no file buffer), use * start and end, this also To hit, such as * scratch * to remind: CX 1 can turn off the window. Emacs expansion instruction, the EMACS button introduced before Part is C- or m-

The form. This is the simplest, which makess an instruction by a pair of press. The button of Emacs can exceed 2 or more. Such as CX 1 or CX CB. Generally more than one button combination is started with CX. In addition you You can also directly down command. You can do an EMACS command after pressing MX. Generally, these command names are very long, but they are not used. We will introduce some. Also introduce how to set these commands into button instructions. The CX CC ends Emacs. However, general Emacs is very cumbersome, once the start is not easy to exit. So comparing the CZ CZ to pause Emacs, return to the command column. When you need to edit, you can play fg% emacs Woke Emacs. In X, CZ is composed of Emacs to the Icon Mode Line Emacs Editing screen consists of a buffer state column (MINIBUFFER). The message displayed here is explained. Here is an example: - ** - Xemacs: Xemacs.QS (Fundamental) ---- 74% ------- Due to the back, 74% indicate the position of the cursor. (Fundamental) indicates the editing mode. This is the most original Mode. Editing Different kinds of articles may wish to use different modes, such as C-Mode, Lisp-Mode, TEX-MODE, TEXT-MODE, and more. There may be more buttons in different modes. For example, TEXT-MODE. MX Text-Mode can be cut into text-mode, which is a mode in which a general person edits text. There is no difference in Fundamental Mode. However, when the cursor moves, Emacs is different for the definition of a word, so MF MB and other moves, A paragraph directive may stop in front of the punctuation symbol. At this time, the status column is transformed into ... (text) ---- 70% - or above is Major mode. There is also Minor Mode, actually Some additional features. For example, MX Auto-Fill-Mode status column is displayed (Auto-Fill is automatically broken, so that the article is fixed to 70 words per row. MX Fundamental-mode can change back. Here Explain , Emacs has the function of auto-completion in Minibuffer, that is, MX Fund and press SPC, which will automatically make fun of Fundamental-Mode, do not have more than two options, it will tell you. This function is Find-file (CX CF) and other file editing functions are also effective. Previously mentioned. Finally explain two **. On the right * indicates that the article has been modified. The left * indicates that this editing area can be modified. Some Emacs's buffer is Read-Only Buffer, which will be made %% indicating that the file is Read-Only. CX CQ can unlock read-only lock, no matter how you want to change this editing area. This is a Toggle directive. If it is possible to modify, CX CQ will cut it into read-only. Search No Search feature editor is a child's toy. Search is a very important function, so Emacs also provides very perfect. CS CR MX REARCH-FORWARD MX RE-Search-Backward MX Search-Forward MX Search-Backward These instructions are basic Search instructions. Cs, Cr is increamental search, which is you typing, emacs directly help you find. One It is Forward, one is backward. What should I do? Press CG to cancel the search, jump back to the original position. Press Enter to let the cursor stop in the found place - this time Markuffer display: Mark Saved Where search Started What do you mean?

It is Isearch to help you set a mark in the original location, then move Point (Cursor) to a new location. Want to jump back to the original place? CX CX is OK. (Exchange-point-mark) Cu C- The SPC can jump back to the place where Mark is set in sequentially. (C-SPC is a MARK, give it an argument, it is back) (I don't remember that the CU can give the following parameters. Some instructions take this Parameters are used as Repeat Count, some instructions are only used as ON / OFF, TRUE / FALSE, SET / CLEAR) MX RE-Search-Forward allows you to search with Regular Expression. MX Search-Forward does not include Increamental Function. Another directive, role, and grep are very similar to: MX Occure and Search have relatively Replace. MX Replace and then press SPC, know. Emacs Settings: Emacs set file is $ homen / .Emacs How much should you? Knowing that Emacs is a editor written with Lisp. EMACS gear is also a syntax setting with LISP. Emacs uses Lisp called ELISP, and a general LISP is a bit. There is an info page, Emacs-Lisp- Intro, in-depth introduction of Emacs Lisp. If you don't, you don't understand Programming, I strongly recommend that you see this document. If you will texinfo, you can print it very beautiful. (some point, two or three days After reading it), if you get. Permacs, I'm strange, what should I do? 1. Change it with VI. Emacs:> 2. Emacs -q into Emacs Major Modes A generally common Emacs Major Mode with Fundamental-mode text -Mode Lisp-Mode has automatic parentheses / rearrangement, direct Lisp Code functionality. C-MODE / CC-MODE C-MODE is the old C-Mode, CC-Mode should be currently new c-mode. Automatic rearrangement / pair The function of parentheses can also be compiled in Emacs, jump to the Compiler Error correction error. The execution program is demug. (With DBX / GDB) Compile is performed through Makefile. Tex-Mode Tex / Latex editing. Must be played some The strange punctuation is relatively convenient. -mode with LISP / CC-Mode. If it is interpreter, Emacs usually can perform / debug.

-Mode also features Tags. HTML-MODE, TEXINFO-MODE, SGML-MODE: Write HTML, TEXI, SGML. W3-Mode WWW Browser. Not satisfied with X-WIN, but acceptable .. Tags tags is a distinctive function? So I want to mention it. This is not an emacs invented, but the vi original special function. Emacs just carry forward a lot. Suppose you have a directory, the original code, the original code, For example, TiN's original code is placed under ~ / tin-1.3beta. You want to see them. First, call Emacs CD to this directory: MX CD then build Tag Table. Tag table is a comparison table, which is recorded Which of the files is reflected in which file is included. With this table, Emacs allows us to travel in the program code. Generally this table is a file, called Tags (capital) M- ! Etags *. [Ch] m-! It is the meaning of External shell command. Etags is Emacs's construction schedule. Just tell it that your Source Code is in that □. VI is using CTAGS, it built The file name is Tags (lowercase). Because we introduced Emacs, no matter whether it is. Then, how do you know? You know that all C programs start from main (), so you want to find main () in which file. Just press M-. Then Emacs will ask where tag table. Because we have already cd to this directory, press ENTER. Then enter main, Emacs will bring you to main () {... } Go. If you see a piece of step call, you haven't seen it, you can move the cursor to the name of the letter, m-. Enter is getting it. If Emacs is wrong (for example Variables and fifths are the same name, Emacs jump to variables), then you can use CU M-. Look. When editing program code, M-SPC is useful, it will zoom in a blank near the cursor. Other places are also effective. Some packages of Emacs: MX Dired (or CX D) Tour / edit catalog, the meaning of the profile of the file MX MX MAN is the man page mx shell to open a Command Prompt, but you can't run VI, ELM, TIN ... MX GNUS read news / read letter MX Rmail read letter MX VM View Mail MX MH-RMAIL Reading (Package MH-E) MX MH-SMAIL Send (Package MH-E) Strong List Recommendation to use Emacs to read news / bbs. The world will be better!

If you read the letter, you will look at your feelings. These readers will move the letter from the system's mail folder to their own directory, take up quota, I don't like: P suggest ELM or MUTT. Unless to participate in the mailling list with procmail. Otherwise Not practical. Use MH-E to install MH this outer program, not very good. It is recommended to write the letter, CC CC can be sent. If your data is managed by RCS / SCCS, Emacs will start Version Control (Minor Mode), CX CQ turns CHECK-IN / Check-out. How to get more information: Emacs's LISP has become a complete self-documenting system after years of development, and many things can be found online. You want information. I have said before, or you have already encountered Backspace, CH (which is backspace's ASCII code) is Help in Emacs, which can bring a string of instructions. Commonly available: CH f Emacs FAQ CH T Emacs Using Ch N Emacs News File, introducing new features recently revoked new features CH I info system. Info is a system for replacing Man Page, basically and text models are similar. There are many important information. I found it here. If you are a newbie, I suggest you look at X-WIN. Otherwise, button M (Menuitem), SPC Next Page L (Last Node: Node is the meaning of the chapter Meaning) u (Up node) D (Directory, Index). BS (Backspace, Back a page). If all Press SPC, just like MAN. Ch K Describe Key tells you to execute the LISP Function. CH f Describe function. Tell you what is Function. If you press SPC, Emacs will give you a list of all LISP functions, and Description. CH V Describe Variable meaning with function. CH a Apropos. For the part string of Lisp Function, Emacs helps you find. CH B lists all of the current keybinding ch m mode help. List the current MODE Specific instructions. CC CH lists all Key-binding at the beginning of CC. Although Emacs can define buttons, all combinations of Ctrl-starting are probably used, only CC is self-defined. However, some modes also violate This space. Current convention is cc left to user, CC C- left to package. These HELPs, your Emacs / ELISP skills grow with time. ELISP profile: Emacs has three manuals. The first is the manual, the second is the ELISP manual, the third is ELISP introduction. The third level is entry level, worth seeing. Elisp manual is also very simple, and teach you Lisp, but a little longer Suitable for reference. Because I didn't study it carefully, so: If there is a coincidence, that is really. Basic Data Type string (string "Hello, World" character (char)? A; question mark Atom &

List: (1 2 3 4) is a list consisting of 4 Atoms. Pair: The middle is a period. (Apple. 2) Alist (Associated List) is a bunch of PAIR's collection, like Perl / TCL Associative Array. Or is a database, a bunch of key, value. 1) (ORANGE. 2) (PineApple. 3)) VECTOR (?) Emacs 19 Use Vector to represent the key (Key Strok Sequence) [F1] [F1 A] NIL is empty List, or said False T true Forms, we have the easiest version of our writer. It is the easiest version. Form is a sample, but it is not the same. Form is ELISP acceptable sentence type. LISP Explosive Preset is the evaluation of each element of the List, unless SPECIAL FORM, there is a special definition. For example, DEFUN FUNC (Arg-List) Body ... ) Is a Special Form, which is used to define a function, so FUNC will not be evaluated, and it is called Symbol, ... (quote (list)) This is also a Special Form, called Lisp Put (List) When doing Symbol Do not evataate. Quote is very common, so there is an abbreviation: '(List)' asymbol can represent an Atom, named the ASYMBOL SET can generate / define new variables. (SET 'HELLO 1); Hello = 1; Note We use 'Hello, so Lisp will not evata Hello value. This guy is very common, there is also a short-write. (SetQ Hello 1) setq is the abbreviation of Set Quote. This is a Special Form No value to the second element. VALUATION Under EMACS, CX CE can perform the narrative of the left side of the code. The result will appear in the minibuffer. Lisp-interaction-mode can evata, and put the result Append to Buffer. The LISP program consists of a bunch of list. This is called expression. Each Expression is back to a value. Some expressions have side effects, such as deleting a word. (this is the meaning of c's Int delete_char () Remove the int, and delete a CHAR) Define the function: (DEFUN NAME (Args-List); Optional (Interactive); Optional Body Defines a letter called Name. Body is a bunch of Expression. Annotations It is used to display CH f. (Interactive) means this letter and the USER / BUFFER function. (Interactive "B") Indicates that the user will ask the USER a Buffer name and then pass it as a parameter. (For example, when User calls this function through key-binding or MX) (Interactive "BAPPEND TO BUFFER: / NR"

When you ask User Buffer Name, the prompt number append to buffer: This function has two quotes, the first is B, which is the second of the buffer is R, region is separated from the / N. (Intective "P") with CU Prefix passes it as a parameter to me. Preset value == 4. CU CF shifts four words some LISP Versions: (List 1 2 3 4) Generate '(1 2 3 4) (car') 1 2 3 4) (CDR '(1 2 3 4)' (CONS 1 '(2 3 4))' (1 2 3 4) (CONS 1 2) (1. 2) (CONS) 0 (CONS 2 NIL)) is equal to '(0 1 2) {List is string with pair, with C, use: Pair: {Object * first, Object * second}; * (Pair [i]. First) == i; pair [i] .Second == Pair [i 1];} (cons' (1 2) '(3 4))' ((1 2) 3 4) (Setq A 1) (SETQ A 1) 1 a); A 1 ( 2 a); A 2 (* 1 2 3 4) (CURRENT-BUFFER); Switch-to-Buffer (Other-Buffer) (Other-Buffer) (Buffer-size) (Point-MAX) (Message ") (," (IF (Test) (Test) (Test) (Test) (Test) (Test) (IF) (IF (Test) Else-Part)) (COND) ((TEST1) BODY1) ((TEST2) Body2) (Test2) (Test2) (LET ((Var1 Value) (Local Variable Var2; No Value (VAR3 Value) ...) Body ...) (Lambda (arg- List) ...) with defun, but there is no name (anonymous) can be saved: (setq hello (message "Hello, World")))))))))))))) (Funcall Hello) (goto-char (Point- MAX)) (DEFVAR VARUE "* Note") If Var does not exist, you can use CH V to see. The annotation of the * number is the user can change / this variable is originally set to the user. You can use MX Edit-Options to set up (Emacs ending, but Edit-options can give you a list of all modified variables, you can put it in the .emacs file. (Directory-files "./ "T"

转载请注明原文地址:https://www.9cbs.com/read-7318.html

New Post(0)