Emacs command set

xiaoxiao2021-03-06  39

Emacs started:

Go directly to Emacs, if you have X-Windows will open the window. If you don't want to use X version,

Use Emacs -NW (No Windows).

Symbol Description

C-X means holding down the CTRL button, then press X, let Ctrl, X let go.

M-X meta meta

On a computer without a META key, M-X is equal to pressing the ESC button first, then press the X button.

The Meta button on the Sun is the key of the rhombus.

Some system META keys are Alt keys. (Or alt keys on a certain side)

The X of C-X or M-X does not write separately.

The EMACS button command is basically a string C- and m-.

More than two buttons commands, Emacs will show what you have pressed at the bottom line of the screen.

This line is called MINI Buffer

End Emacs Press C-X C-C

Cancel C-G

Some emacs commands will run for a long time, can be interrupted with C-G. Pressing the missed button to cancel it by C-G.

Up-bottom movement C-P (Next Line)

Left and right moving C-F right (Forward) C-B to left (backward)

In fact, there is no concept in the emacs, put an article in a big buffer

Inside, C-F (forward) is moving to the end, C-B (Backward)

It is the meaning of moving back, one word.

Turn the next page C-V (View next screen)

Previous M-V

When turning, the last end will stay at the top of the screen to maintain continuity.

Emacs will automatically hop on the spot when the cursor is close to the screen, and move the file forward.

Convenient to read.

Heavy painting screen C-L

The special name of the cursor in Emacs is called Point. Point == Cursor current points

Cursor once jumping a word (Word) M-F to jump M-B

Note that C-F and M-F, C-B and M-B are symmetrical.

Move to line C-A row C-E

Move to Jun M-A to Term M-E

(M-A is behind the previous period, the beginning of a sentence.

M-E is behind the period)

Move to pentress M- <档 M->

Delete the cursor's currently referring to the word C-D

Front word Del (delete "

Del is called Rubout (Rub Out)

M-DEL Removes a word (Word)

M-D is deleted forward (behind the cursor)

C-K Delete to the end of the end (kill)

M-K deletes a child end (deleted period) (kill)

Note Backspace = C-H is Help under Emacs.

Later, there is (kill), indicating that this deleted action is KILL, not equally equal to Delete.

Emacs will put the kill of things in Kill Ring, is a temporary place.

You can call it later. See YANK instructions.

Undo: C-X u

C-_ equals C-X u Some DEC terminals, C- / is C-_ _

Sometimes I am equal to C-Shift- -

Repeated execution

For example, 8 words are removed right, C-U 8 C-F

C-U is quite special in Emacs, used to set some quotes (Argument / Repeat Count)

Give it a command.

C-U 2 0 C-N moves down 20 lines

There is a special exception, C-U 3 C-V is not turning three pages, but the entire screen moves up.

It is said that this is more meaningful.

C-U 1 0 C-X u Undo 10 times

What is the quoter for C-L:

C-U 0 C-L will redraw the screen and move the current row to the first line of the screen.

In addition, C-U 100 is equal to M-100

C-U number is equal to M-numbers

X windows,

C-LEFT C-Right moves one word (Word).

C-Up C-Down moves a paragrahead (if the paragraphs / C language is block)

Home = C-a

END = C-E

C-home = m- <

C-end = m-> pgup pgdn = m-v C-V

Set the number of revitalities is simpler,

For example, remove 10 words to right C-1 C-0 Right-Arrow

Just hold Ctrl, then hit 10, it is simpler than C-U 1 0.

MOUSE Middle Key Use to select a place with Hi-light.

Right-click Menu-Button

If you accidentally press ESC, equal to M-ESC, there will be a message to run out

Say you press to a disabled command. This is a senior directive, the author thinks

Beglologists don't use it, so I will ask you to start it, generally answer no.

If a certain row is too long, the screen is not displayed, Emacs will play a $ on the right side of the screen.

Indicates that this line is not finished, and there is also the right.

Demolition of a line into two lines: Press Enter when you want to remove it.

Merge two lines: Press C-D at the end of the line (or the first Press DEL)

YANK: Spit out (killed).

As long as you delete it with Kill (C-K, M-K, etc.), more than one word,

Emacs will save it, then C-Y can call it.

The function is the same as Cut & Paste. Kill and Delete are different, only

The things dropped in Kill can be spit back in Yang.

The cursor does not move in the same place, and the information that is rid of the continuous KILL will be downgrade it.

It will come back together when Yang.

The information dropped by Kill is placed on the data structure called Kill Ring, and Ring is a circle.

The things dropped by Kill will be placed on the circle. Yang will put back the most recent KILL.

If you are not what you want, you can change with M-Y. (M-Y is telling Emacs, not right,

I am not going to be this one, and I will give it to me).

M-Y is following the C-Y.

Method for copying text == Continuous C-K a few times, remove all the rows to copy,

Then press C-Y to get back. If you want to copy, you will be C-Y.

Put the information you want to copy in Yank back seems to be stupid. It is more civilized.

Method, that is, M-W, but it is more troublesome.

First, set the tag first. Mark is set with C-SPC or C- @ @ 然候

Move the cursor to the other side, press M-W to put Mark to Point

The word is stored on Kill Ring. Point is the meaning of the cursor.

Emacs does not use the place to use highlight, unless it is in X.

Under X, you can use M-W to copy the text of the white mouse.

Kill & Yank is the meaning of Cut & Paste.

Most of the above instructions are also valid for the Bash commander.

Archive operation

Reading: Emacs Terminology is Finding A File.

C-X C-f then enters the file in Mini-Buffer. When you enter a file name, the SPC key has

Auto-Complete features, or show a few new files

The words are the same as input. (Tab keys also have similar functions)

C-X C-f called Find-file

C-X C-S Archive (Save Current File, Save Current Buffer)

C-X S save all files

C-X i inserts the file to read the contents of additional files in the current editing area

Windows

Emacs read the file in the buffer.

We look through the Window / edit buffer.

Two windows will cut the screen into two parts, they can display at the same time

The same, or different files.

For beginners, what is most needed is to remember how to disappear without the desired window:

C-x 0 Turn off the current window

C-X 1 will allow the current window to accounted for the entire screen (one window),

Cancel / turn off other windows.

There are many features in Emacs to open a small window and communicate with the user, display the message.

Sometimes it will not automatically disappear, C-X 1 is useful.

Another function is how to jump to another window.

C-X o (Other-Window)

C-X 2 cuts the current window into two (horizontal segmentation)

C-X 3 (vertical segmentation)

C-X 4 is a string of instructions related to the window.

C-X 4 is a string of instructions related to the window.

C-X 5 is an extension to the X-X-X-X-X 5 2 is another X Window again.

Multi-file editor

C-X C-B see that there are "Buffers, where Emacs is released).

C-X b Then enter the name of the buffer in Minibuffer, you can switch the edit buffer.

The Tab key also has a function. Some internal buffers (there is no file of the buffer),

Is the beginning and end, this is also hit, such as * scratch *

Premier reminder:

C-X 1 can turn off the window.

EMACS expansion instruction

Most of the EMACS buttons in the previous introduction are in the form of C- or m-.

This is the easiest point of method, which makes a pair of buttons constitute an instruction.

The button of Emacs can exceed 2 or more. Such as C-X 1 or C-X C-B.

Commands typically more than one button combination are started with C-X.

In addition, you can directly down command. You can play an EMACS after pressing M-X.

Order is executed. Generally, these command names are very long, but they are not used. Wait a minute

We will introduce some. There is also how to set these commands into a button directive.

C-X C-C is ending Emacs. However, general Emacs is very cumbersome, once the start is not easy

Exit. So is more commonly used in C-Z

C-Z pauses Emacs and returns to the command. When you need to edit next time, play fg% emacs

You can wake up Emacs.

Under X, C-Z is shrunk into icon

Mode Line

Emacs Editing Screens By Editing Zone (MODELINE) and the MINIBUFFER

Composition. Explain the message displayed by Modeline here.

The following is an example:

- ** - Xemacs: Xemacs.QS (Fundamental) ---- 74% -------

Explain from the back, 74% indicate the position of the cursor.

(Fundamental) means editing mode. This is the most original mode. Edit different types of articles

It may be desirable to use different modes, such as C-Mode, Lisp-Mode, TEX-MODE, TEXT-MODE

Wait. There may be more buttons in different modes. Examples of TEXT-MODE.

M-X Text-Mode

You can cut into Text-mode, which is a mode in which a general person is editing. And Fundamental Mode

Nothing difference. However, when the cursor moves, Emacs is different for a word definition, so

M-F m-b moves a word, a paragraph instruction may stop in front of the punctuation symbol.

At this time, the status column is transformed into ... (text) ---- 70% ---

The above is Major mode. There is also Minor Mode, in fact, some additional functions.

For example, M-X Auto-Fill-Mode is status column display (Text Fill).

Auto-Fill is automatically broken, allowing the article to fix 70 words per row.

M-X Fundamental-Mode can change back.

Here to explain this, Emacs has the function of Auto-Completion in Minibuffer,

That is to play M-X Fund and press SPC, which will automatically make fun of Fundamental-mode,

No need to hit. If there are more than two choices, it will tell you. This function is

Find-file (C-X C-F) 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 * represents this editing area (buffer) can be modified.

There are some Emacs's buffer is Read-Only buffer, which will be made%

%% means that the file is Read-Only.

C-X C-Q can unlock the Lock of Read-Only, no matter how you want to change this editing area.

This is a Toggle instruction. If it is modified, C-X C-Q will cut it into

Read-only.

Search

An editor without Search features is simply a toy for children. Search

It is a very important feature, so Emacs also provides very perfect.

C-S

C-R

M-X RE-Search-ForwardM-X RE-Search-Backward

M-X Search-Forward

M-X Search-Backward

These instructions are basic Search instructions. C-S, C-R is increamental search,

It is also your typography, Emacs will help you find it. One is Forward, one is Backward.

What should I do? Press C-G to cancel the search and jump back to the original position. Press Enter to let the cursor

Place where you are found - MINIBUFFER Display: Mark Saved Where Search Started

What do you mean? It is ISearch to help you set a mark in the original position, then put the Point

(CURSOR) Move to a new location.

Want to jump back to the original place?

C-X C-X is OK. (Exchange-Point-and-Mark)

C-U C-SPC can sequentially jump back to the place where Mark sets a few times.

(C-SPC is a MARK, give it an argument, is a reactionary action)

(Also remember that the C-U can set some parameters to the following instructions.

Some instructions take this parameters as a Repeat Count,

Some instructions are only used as ON / OFF, TRUE / FALSE, SET / CLEAR)

M-X RE-Search-Forward allows you to search with Regular Expression.

M-X Search-Forward does not have an increamental functionality.

Another instruction, role, and grep are very similar:

M-X Occure

Compared with Search, it is REPLACE.

M-X Replace and then press SPC and you know.

Emacs settings:

The Emacs setup is $ HOME / .EMACS

How much do you know that Emacs is an editor written by Lisp, and the .emacs gear is also

To set with Lisp. The LISP used by Emacs is called ELISP, and a general LISP is a little bit.

There is an Info page, Emacs-Lisp-Intro, in-depth introduction of Emacs Lisp.

If you still don't, you don't understand Programming, I strongly recommend that you look at this file. If you

Will Texinfo, you can print it very beautiful. (The content is a little bit, two or three

After reading it)

If you put it. Permacs, I'm strange to enter Emacs. What should I do?

1. Change it with VI. Permacs:>

2. Emacs -q into EMACS

Major Modes

Generally common Emacs Major Mode

Fundamental-mode

TEXT-MODE

Lisp-modes have automatic parentheses / rearrangements, direct Lisp Code features.

C-MODE / CC-MODE C-MODE is the old C-Mode, CC-MODE should be

Currently new C-Mode. There are automatic rearrangement / parentheses.

You can also compile in Emacs, jump to Compiler Error

Correct error. DEBUG when the execution program. (With DBX / GDB)

Compile is performed through Makefile.

TEX-MODE TEX / LATEX editing mode. Maybe it's a strange punctuation

The symbol is relatively convenient.

-mode

With LISP / CC-Mode. If it is interpreter,

Emacs usually perform / debug directly.

-mode also has the function of Tags, which will be described later.

HTML-MODE, TEXINFO-MODE, SGML-MODE: Writing HTML, TEXI, SGML.

W3-Mode WWW Browser. Not satisfied with X-WIN, but accept ...

Tags

Tags is a distinctive function? So I want to mention it. This is not an emacs invented,

It is the original specific function of VI. Emacs just carry forward a big.

Suppose you have a directory, which is a program of raw code, such as the original code of TiN, put below ~ / tin-1.3beta. You want to see them.

First, call Emacs CD to this directory:

M-X CD

Then, create a Tag Table.

Tag table is a comparison table, which symbol is recorded (Variable / Function Call)

Which file is included? With this table, Emacs can make us fast

Tour in the code. Generally, this table is a file called Tags (uppercase)

M-! Etc. [Ch]

M-! It is the meaning of executing External shell command. Etags is the Emacs's construction schedule.

You just tell it that your Source Code is in that □.

VI is to use the CTags program, which is called tags (lowercase). Because

We introduce Emacs, so no matter it.

Then, how do you find out? You know that all C programs are started by main (), so you want

In which file is found. When you press M-. Then Emacs will ask you tag table.

Where is it. Because we have already cd to this directory, press Enter directly. Then enter main,

Emacs will take you to main () {...}.

If you see a piece of step call, you haven't seen any functions, you can take the cursor

Move to the name of the function, M-. Enter is getting it.

If Emacs is wrong (such as variables and fifths are the same name, Emacs jumps to variables),

Then you can use the C-U m- to find the next one.

When editing the program code, M-SPC is useful, it will shrink blank around the cursor.

It is also effective in it elsewhere.

Some of Emacs Package:

M-X DIRED (or C-X D)

Tour / edit catalog is the meaning of the archives

M-X Man is Man Page

M-x shell opens a Command Prompt, but you can't run VI, ELM, TIN ...

M-X gnus reading news / read letter

M-X RMAIL read letter

M-X VM View Mail

M-X MH-RMAIL Reading (Package MH-E)

M-X MH-SMAIL Send (Package MH-E)

Strong list recommendation to use Emacs to read the News / BBS. The world will be better!

If you read the letter, you will look at your feelings. These read letters will believe in the Mail Folder from the system.

Move it to your own directory, take up quota, I don't like: P suggest ELM or MUTT.

Do not be practical unless you participate in the Mailing List.

Use MH-E to install MH this external program, not very good. It is recommended to VM or GNUS.

Write a letter, C-C C-C can be sent.

If your data is managed by RCS / SCCS, Emacs will automatically start Version Control.

(minor mode.), C-X C-Q turns CHECK-IN / CHECK-OUT.

How to get more information:

After years of development, Emacs has become a complete self-documenting system.

Many things can be found on the line.

As mentioned earlier, or you have already encountered backspace, c-h (that is, Backspace

The ASCII code) is HELP inside Emacs, which can bring a string of instructions.

Commonly used:

C-H f Emacs FAQ

C-H t emacs use teaching

C-H N Emacs News File, introducing new features recently revised

C-H i info system. Info is a system for replacing Man Page,

Basically and the WWW of the text is similar. There are many important information

Can be found here. If you are a newbie, I suggest you under x-win

See. Otherwise, button M (Menuitem), SPC Next Page

l (Last Node: Node is the meaning of chapter) U (Up Node)

D (Directory, Index). BS (Backspace, Back A Page).

If you only press SPC, just like the man. C-H k Describe key, tell you to press this button to perform the LISP function.

C-H f Describe function. Tell you what Function is doing.

If you press SPC, Emacs will give you a list of all LISP functions, and instructions.

C-H v Describe variable with function.

ApproxImate. Part of the LISP Function

String, Emacs helps you find.

C-H B lists all of the keybinding

C-H m Mode Help. List the special instructions for the current MODE.

C-C C-H lists all Key-binding at C-C. Although Emacs

You can define buttons, but all combinations of Ctrl-starting are probably used.

Only C-C is a self-definition. However, some mode also violates this space.

Current convention is C-C left to User, C-C C-

Leave Package.

With these HELP, your Emacs / ELISP skills grow over time.

ELISP Introduction:

Emacs has three manuals. The first use manual, the second is the ELISP manual, the third is

Introduction to ELISP. The third level is entry level, worth seeing. Elisp manual is also written

Very simple, still teach you LISP, but a little longer, suitable for reference.

Because I didn't study it carefully, so:

As follows, if there is a coincidence, it is true.

Basic Data Type

String "Hello, World"

CHAR)? A; the beginning of the question mark

Atom & List:

(1 2 3 4) is a list consisting of four Atoms.

Pair: The middle is a period.

(apple. 2)

AliST (Associated List)

It is a collection of Pair, just like Perl / TCL ASSociative Array.

Or is a database, a bunch of key, value.

'((Apple. 1)

(Orange. 2)

(PineApple. 3))

Vector (?)

Emacs 19 uses vector to represent the key (Key Strok Sequence)

[F1] [F2] [F1 A]

NIL is empty List, or represents False

T true

Forms

The best version of our writer has the easiest version of us to fill in.

Form is a sample, but it is not much like it.

Form is the sentence pattern that ELISP accepts.

The LISP Explosive Preset is the evaluation of each element of the List,

There is a special definition unless SPECIAL FORM. For example

(Defun Func (arg-lis)

Body ...)

It is a Special Form that is used to define a function, so FUNC will not be

Ask, being used as Symbol, ...

(quote (list))

This is also a Special Form, called LISP (List), just as Symbol,

Don't evataate.

Quote is very common, so there is an abbreviation:

'(List) is equal to (quote (list))

'Asymbol can represent an Atom, name is Asymbol

SET can generate / define new variables.

(Set 'Hello 1)

Hello = 1

Pay attention to us with 'Hello, so Lisp will not evata Hello value.

This guy is very common, there is also a short written.

(SetQ Hello 1)

Setq is the abbreviation of set quote. This is a Special Form, no

The second element is evaluated.

Valuation

Under EMACS, C-X C-E can perform (Evaluate, evaluation) the narrative of the left side of the cursor. The result will appear in Minibuffer.

C-J can evataUte in Lisp-Interaction-Mode, and put the result Append to Buffer.

The LISP program consists of a bunch of List. called Expression.

Each Expression is returned back to a value.

Some expressions have side effects, such as deleting a word.

(This is the same as C's int delete_char (), it returns Int,

And delete a char)

Define a function:

(Defun name (args-lis)

"Note"; OPTIONAL

(Interactive); Optional

Body)

Define a letter called Name. Body is a bunch of Expression.

The annotations are used to display C-H f.

(Interactive) means this letter and the USER / BUFFER.

(Interactive "B") means that the user will ask USER a Buffer name,

Then it is passed to it as a parameter. (For example, when USER passes key-binding

Or when M-X call this one)

(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, is buffer

The second is R, Region

Separate with / N.

(Interactive "P") uses the prefix set by C-U and passes it as a parameter to me.

Preset value == 4. C-U C-f moves four words to right

Some LISP functions:

(List 1 2 3 4) Produced '(1 2 3 4)

(car '(1 2 3 4) 1

(CDR '(1 2 3 4)' (2 3 4)

(CONS 1 '(2 3 4))' (1 2 3 4)

(CONS 1 2) (1. 2)

(cons 0 (cons 2 nil)))

Isometrical '(0 1 2)

{List is string with pair,

Expressed with C:

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)

(1 a); A 1

( 2 a); A 2

(* 1 2 3 4)

(current-buffer; transferring the current Buffer data item

Switch-to-buffer (Other-Buffer)

(set-buffer)

Buffer-size

(SetQ Current-Pos (POINT))

(Point-min)

(Point-max)

(Message "Hello"; Show Hello in Minibuffer

(IF (TEST)

(THEN-Part)

(Else-Part))

(Cond ((TEST1) BODY1)

((TEST2) BODY2)

(TiTher-Wise)

(LET ((var1 value); Local Variable

Var2; no value

(var3 value)

...)

Body ...)

(lambda (arg-list) ...) with Defun, but there is no name (anonymous). You can save the variable:

(setq Hello (Lambda () (Message "Hello, World"))))))))))

(Funcall Hello)

(goto-char (Point-max))

(Defvar Value "* Note") If Var does not exist, it can be used

C-H v look. Note to the * number table is that the user can change directly / this variable is

Set it to the user.

You can use M-X Edit-Options to set up (Emacs is endless,

However, Edit-Options can give you a list of all modified variables, you can

Put it in the .emacs.

(Directory-files "./" t "//..*")

Return A List of Files Under Directory X

(Load "xxxx.el") with #include

Set it to the user.

You can use M-X Edit-Options to set up (Emacs is endless,

However, Edit-Options can give you a list of all modified variables, you can

Put it in the .emacs.

(Directory-files "./" t "//..*")

Return A List of Files Under Directory X

(Load "xxxx.el") with #include

(setq load-path (cons "~ / emacs" load-path)); LOAD's search path.

(AutoLoad ...) Unlike LOAD, you will directly evateuate the entire file, but it needs again.

LOAD.

(local-unset-key [(Control C)])

(local-set-key [(Control C) a] 'Forward-SEXP)

SEXP is an Expession, n expression if it is enclosed in parentheses.

(The definition of Expression is different with the language, in C, LISP

TEX, HTML, FORTRAN have different differences)

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

New Post(0)