Emacs Common Commands

Source: Internet
Author: User
Tags clear screen save file

1. Leave Emacs
Suspend Emacs C-z
Exit Emacs C-x c-c
2. Documents
Open File C-x c-f
Save File C-x c-s
Save all the files C-x s
Inserts the contents of a file into the current buffer C-x I
Replace the current file with the content of the file you need C-x c-v
Writes the current buffer content to the file you want to save C-x c-w
Sets the current buffer to read-only mode C-x C-q
3. Get help
Open Emacs Tutorial C-h T
Switch to the current window C-x 1
Search for help documents that contain a string C-h A
Search Help documents for a set of shortcut keys C-h K
Search Help documents for a function C-h F
Get the current mode information C-h m
Query all shortcut keys that start with C-x C-x c-h
Prompt to enter a key combination that shows what command the key combination is bound to. C-h C
Browse Info Info C-h I
300 recently entered combination keys C-h L
View Bindings Hotkey C-h b
4. Error recovery
Terminates the current command input C-g
Recover lost files when the system crashes M-x recover-session
Undo Action C-x u,c-_,c-/
Restore buffer to the original content M-x Revert-buffer
Clear Screen C-l
5. Incremental Search
Forward Search C-s
Back to search C-r
Find State Toggle Case Sensitive M-c
Find State Auto Match M-tab
Find status go to find help C-h c-h
Find status cuts the cursor until the end of the line to the lookup area C-w
Find status copies the cursor until the end of the line to the lookup area C-y
Find status Copy the last item in the kill ring to the lookup area M-y
Find State Delete Lookup area last character C-m-w
The lookup state copies the characters at the cursor to the lookup area at the end C-m-y
Make a simple search forward C-s Ret
Make a simple search backwards C-r Ret
Forward phrase search M-s W
Forward phrase lookup (non-incremental) M-s W Ret
Phrase lookup backwards (non-incremental) M-s W c-r Ret
Forward Regular Lookup C-m-s
Make regular lookups backwards C-m-r
Full text replacement M-x replace-string
Full-text regular replacement M-x Replace-regexp
Find replacements M-x Query-replace
Go to recursive editing M-x Recursive-edit
Exit Recursive edits M-x Abort-recursive-edit
Exit Recursive edits M-x top-level
6. Mobile
Move in a character unit C-f, C-b
Move in a word unit M-f, M-b
Move to the beginning of the line, at the end C-a, C-E
Move to the first non-whitespace character M-m
Move to the head of the sentence, end of sentence M-a, M-E
Move to paragraph header, end of paragraph m-{, M-}
Page C-v, M-v
To file header and end of file M-<, m->
To the nth byte of the file M-x Goto-char
To the nth line of the file M-x Goto-line,m-g G
Set Goal-column C-x C-n
Cancel Goal-column C-u C-x C-n
Jump to the top of the function C-m-a
Skip to function end C-m-e
Jumps to the next sibling syntax structure C-m-f
Jumps to the previous sibling syntax structure C-m-b
7. Delete
Delete in character units DEL, c-d
Delete as a word M-del, m-d
Delete in behavior unit M-0 c-k,c-k
Delete as a paragraph C-x del,m-k
Shear E-1
Copy M-w
Paste C-y
Use the last cut content to paste M-y
8. Mark
Set a marker from the cursor [Email PROTECTED],C-SPC
Swap cursor position and mark C-x C-x
Mark Words [Email protected]
Mark a paragraph M-h
Markup page C-x c-p
Mark Sexp Chunks [Email protected]
Tag function C-m-h
Mark Entire buffer C-x h
9. Replace
String substitution m-%
Regular expression substitution c-m-%
Replace mode next one replace Spc,y
Replace only one in the replacement mode ,
Replacement mode does not replace the current direct jump to the next Del,n
Replace all in the replacement mode
Exit Replacement Mode Ret
10. Multiple window
Close other window (frame) to display only the cursor window C-x 1, c-x 5 1
Split window horizontally C-x 2
Split window vertically C-x 3
Open a new frame C-x 5 2
Close the current window (frame) C-x 0,c-x 5 0
Scrolling other Window C-m-v
Switch to another window (frame) C-x o,c-x 5 O
Switch to another buffer C-x 4 B
Display buffer in other window C-x 4 C-o
Open a file in another window C-x 4 F
Open a read-only file in another window C-x 4 R
Open a table of contents in another window C-x 4 D
Look for tags in other windows C-x 4.
Extrude window down C-x ^
Zoom left Window C-x {
Pull the big window to the right C-x}
11. Formatting
Indent (dependent mode) TAB
Area indent (dependent mode) C-m-\
Sexp indent (dependent mode) C-m-q
Add Comment m;
Add a new line after the cursor C-o
Delete a blank letter C-x C-o
Remove all whitespace around the cursor M-\
Set appearance M-o
12. Case
Word capitalization M-u
Word lowercase M-l
Capitalize first letter M-c
Area uppercase C-x C-u
Area lowercase C-x c-l
13.MiniBUffer
Complement the whole TAB
Complete Word Spc
Perform Ret
Show possible executions
Last Minibuffer input M-p
Input of the last Minibuffer M-n
Search Backwards in Minibuffer L-s
Search forward in Minibuffer M-s
End the input in the Minibuffer C-g
14.Buffer
Select buffer C-x b
List all the buffer C-x C-b
Close Current buffer C-x K
15. Replacement
Displace character C-t
Replace Word M-t
Displacement line C-x C-T
Displace Sexps Area C-m-t
16. Spell Check
Current Word spelling check m-$
Word Check in area M-x ispell-region
Word Check in buffer M-x Ispell-buffer
17.Tag
Find a tag M-.
Find Next Tag C-u m.
Specify a tag file M-x visit-tags-table
Recursively search the entire tag file M-x Tags-search
Tag Lookup substitution M-x Tags-query-replace
Continue the last tag find or replace M-,
18.Shells
Execute a shell command m-!
Executing shell commands in the current zone m-|
Open a Shell window M-x Shell
19. Rectangular area
Copy a rectangular region to a register C-x R R
Delete a rectangular area C-x R K
Paste an area C-x R y
Insert a rectangular block, the word aligns move C-x R O
Clears a rectangular block to make it a white space character C-x R C
Inserts the specified character in the selected rectangular block C-x R T
20. Abbreviations
Add global abbreviation C-x A G
Add an abbreviation for a mode C-x a L
Dynamically extending the previous word m-/
21. Regular Expressions
Replace any character except line break .
Replace 0 or more characters *
Replace 1 or more characters +
Replace 0 or 1 characters
Regular expression character C \c
Or \|
Group \(\)
Header ^
End of Line $
The first word \<
End of Word \>
Buffer Head \‘
Buffer tail \‘
Group of characters included [...]
Group of characters not included [^...]
22. Character Encoding
Setting up the language environment C-x RET L
Display Input Method M-x List-input-methods
Turn off IME on C-\
Setting up an encoding environment C-x RET C
Display Coding System M-x List-coding-systems
Choose your preferred Coding system M-x Prefer-coding-systems
23.Info
Enter Info document C-h I
Search for specific functions and variables in the info document C-h S
24. Register
Save the current zone to a register C-x R S
Inserting the contents of the register into buffer C-x R I
Save current point to register C-x R SPC
Jump to a register C-x R J
25. Key Macro
Start defining key macros C-x (
End key Macro definition C-x)
Perform the last defined key macro C-x E
Add to the last key macro C-u C-x (
Name the last key macro M-x Name-last-kbd-macro
Inserting a Lisp definition in buffer M-x Insert-kbd-macro
26. Handling Commands with Elisp
Executes a LISP statement at the current point C-x C-E
Executing the current function C-m-x
Executing the current zone M-x eval-region
Reads commands from Minibuffer and executes M:
Load the standard system library M-x load-library
27. Simple Configuration
Open the Configuration page M-x Customise
Set Key Bindings (Global-set-key (kbd "C-c g") ' Search-forward)
28. Writing Commands
command to write a template (Defun command-name (args) "Documention" (interactive "template") body)

Emacs Common Commands

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.