Emacs Novice Notes (i)--read "Emacs Tutorial"

Source: Internet
Author: User

"Emacs Tutorial" is an introductory material familiar with Emacs. Altogether dozens of orders, do not need hard to remember, can practice can.

page Turn command :

c-v: Move one screen forward

m-v: Move backward one screen

c-l: Redraw the screen and place the line of the cursor in the center of the screen

Cursor Control :

c-n: Move to Next line (next)

c-p: Move to the previous line (previous)

c-f: Move one character to the right (forward)

c-b: Move one character to the left (backward)

m-f: Move right one word "to Chinese is move to next punctuation"

m-b: Move one word to the left "to Chinese is to move to the previous punctuation mark"

c-a: Move to the beginning of the line

c-e: Move to end of line

m-a: Moving to the beginning of a sentence

m-e: Moving to the end of a sentence

m-<: Move to the beginning of all text

m->: Move to the very end of all text

On most keyboards, the greater than and less than sign need to be entered with Shift.

Numeric Parameters :

c-u n cmd: command cmd executes n times repeatedly.

For example: C-u 8 c-f will move forward 8 characters.

Terminate command :

c-g: You can terminate a command that has been executed too long, or you can cancel the numeric parameter and enter only half of the commands.

Turn off the other panes :

c-x 1: Turn off all other panes

There are a series of commands that start with c-x, many of which are related to panes, files, buffers, and so on.

Insert and delete :

<Delback>: Delete a character before the cursor

c-d: Delete a character after the cursor

m-<delback>: Remove a word before the cursor

m-d: Remove a word from the cursor

c-k: Removes the character from the cursor to the end of the line

m-k: Removes the character from the cursor to the end of the sentence

In the Windows keyboard, the Backspace key is <Delback>.

to remove any part of the buffer :

First move the cursor to the end of the area you want to remove, press [email protected], then move the cursor to the other end, press c-w to remove the text between two points

recall the removed text :

c-y: Inserts the last removed content at the cursor

Continuously press c-y, you can recall the last removed text, which actually realizes the function of copying.

m-y: Inserts the previous removed content at the cursor

Press M-y continuously to recall content that was removed the previous time.

Revocation :

c-x u: Eliminate all changes caused by one command

file :

c-x c-f: Looking for a file

c-x c-s: Save this file

If a file is found that does not exist, a new file is created. However, Emacs does not actually create the file until you save it.

You can use C-x c-f to open multiple files, to cut back the first file, you can also use C-x c-f.

buffers :

Emacs places the files in each edit in a place called buffer. In each search for a file, Emacs creates a buffer within it.

c-x c-b: List all current buffers

c-x b: Toggle Buffer

c-x s: Saving multiple buffers

Buffers and files are corresponding, so you can also switch buffers with c-x c-f.

However, the buffer does not always have a corresponding file: For example, "*messages*" buffer has no corresponding file, it is stored in the bottom of the EMACS message.

command Set Extensions :

C-x: Character extension (after c-x, enter another character or key combination)

M-x: Command name extension (after m-x, enter a command name)

C-x has a lot of extension commands, the above has learned C-x C-f, c-x c-s and so on. Another example:

c-x c-c: Leaving Emacs

Command name extensions such as:

m-x replace-string: Replace one string with another within the full text range

Auto Save :

Emacs periodically writes the file being edited to a "AutoSave" file with a "#" character in the original file name. The file will be deleted after the normal disk is saved.

m-x recover file<return>: Recovering files

Toggle Main Mode :

m-x text mode<return>: Switch to Text mode (can also switch to other modes such as fundamental, etc.)

c-h m: View the document for the current main mode

Secondary mode :

Auxiliary mode provides some auxiliary functions. Each auxiliary mode can be turned on and off independently, regardless of the other auxiliary modes, and not with the main mode. Such as:

m-x Auto Fill mode<return>: Start/close auto wrap mode

c-u c-x F: Set the maximum number of characters per line to 80

m-q: Manual Wrapping (the cursor must be in the segment where the line is to be broken)

Search :

c-s: Search Down

c-r: Search up

Emacs is a progressive (incremental) search, meaning that the search and input are simultaneous.

Press C-s once again to search for the next occurrence. Press <Return> to end the search.

multiple panes :

c-x 2: Divides the screen into two panes, with the cursor resting in the upper pane

c-m-v: Scroll down the lower pane (edit in one pane, useful when using another pane as a reference)

c-m-s-v: Scroll up the lower pane (CONTROL, META, and SHIFT Press V)

c-x o: Move the cursor to another pane

c-x 4 c-f: The found file appears in the lower pane, and the cursor jumps there

for more help :

EMACS provides commands to view the command documents, which begin with Ctrl-h.

c-h? : Emacs Lists what help it can provide

c-h C c-p: Emacs gives a brief description of this command (C-P)

c-h k c-p: Opens a new pane to display the name of the function and its document

c-h F previous-line<return>: Interpreting a function (Previous-line)

c-h v: Document showing Emacs variables (variables can be used to "customize Emacs Behavior")

c-h a: Related command Search (after entering a keyword, emacs lists the list of M-X commands that contain this keyword in all command names)

c-h i: Read the online manual (i.e., the usual Info)

The c-h I command will open a special buffer called "*info*", where you can read the software user manual. Click on M Emacs <Return> to read the user manual for Emacs. Press "?" Access to Info Guide. Emacs Info is our main reference document.

Emacs Novice Notes (i)--read "Emacs Tutorial"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.