1) commands related to file operations
C-x C-F: Find the file and open it in the new buffer.
C-x C-V is used to read another file and replace the file opened with C-x C-F.
C-x I insert the file to the current position of the cursor
C-x C-s save the file
C-x C-W writes the buffer content to a file.
C-x C-C Exit Emacs
2) commands related to the cursor movement operation
C-F move the cursor one character forward (right)
C-B move one character behind the cursor (left)
C-P move the cursor forward one line (up)
C-n move the cursor behind a row (bottom)
M-F move a word forward
M-B move one word behind
C-a move to the beginning of the line
C-e move to the end of the row
M-e advances a sentence
M-a move a sentence behind
M-} Move forward a paragraph
M-{move a paragraph behind
One screen on the C-V Screen
One screen at the bottom of the M-V Screen
C-x] One page forward
C-X [move one page behind
M-<forward to File Header
M->; move to the end of the file
C-l re-draw the screen and place the current row in the center of the screen
M-N or c-u n repeatedly execute n subsequent commands
Press M-X and enter "Goto-line" in the auxiliary input area to jump to the specified line. Enter "Goto-char" to jump to the specified character.
3) commands related to File Deletion
C-d: Delete the character at the cursor position
Del Delete the character before the cursor
M-D: delete words behind the cursor
The M-DEL removes words before the cursor
C-k is deleted from the cursor position to the end of the row.
M-K deletes the sentence behind the cursor
C-x del Delete the sentence before the cursor
C-y restore deleted text or paste recently deleted or copied text
C-W: delete a file Block
Press M-X and enter "Kill-paragraph" in the auxiliary input area to delete the section after the cursor. Press "backward-kill-paragraph" to delete the section before the cursor.
4) commands related to text block operations
C-@ mark the start (or end) Position of the text block
Position of the C-x interchange insertion point and text mark
C-W or SHIFT-DEL delete text blocks
Copy text blocks from m-W
M-H mark paragraph
C-x C-p Mark page
C-x H indicates the entire buffer zone
5) commands related to location Switching
C-T exchanges two characters
M-t swap the location of two words
C-x C-T exchanges the location of two text lines
After pressing M-X, enter "transpose-sentences" in the auxiliary input area to switch the positions of the two sentences. Press "transpose-paragraph" to switch the positions of the two paragraphs.
6) commands related to changing the case sensitivity of letters
Change the initial letter of M-C to uppercase.
Change all m-u letters to uppercase letters.
Change all letters of M-l words to lowercase letters.
7) search-related commands
C-s incremental forward search
C-r incremental search
C-s c-W starts incremental search, and the words at the cursor position are used as search strings.
C-s c-y starts incremental search, and the text between the cursor position and the end of the line is used as a search string.
C-s return searchstring return start non-incremental search operation Forward
C-r return searchstring return start non-incrementing search operation backward
C-s return C-W start word search (not affected by line breaks, spaces, and punctuation marks)
C-r return C-W start word search backward (not affected by line breaks, spaces, and punctuation marks)
Commands related to editing buffers and windows
C-x B. If you enter a new file name, create a new file and edit it. Otherwise, open the file.
C-x s save all the buffers
C-x B deletes the buffer
M-x rename-buffer rename the Current Buffer
C-x C-Q: set the current editing buffer to read-only.
C-x 0: Delete the current window
C-x 1 the current buffer is displayed on full screen
C-x 2: Create the upper and lower arranged window
C-x 3: create a window in the left and right directions
C-x O moves between windows
After setting my Emacs, these changes make me more comfortable to use ~~
; Disable startup information
(Setq inhibit-startup-message T)
; Set the title to "file name @ LC's Emacs"
(Setq frame-title-format "% B @ LC's Emacs"
; Displays the column number
(Setq column-number-mode t)
; Set the default number of columns to 110
(Setq default-fill-column 110)
; Set kill-ring-max (I don't know how to translate the word :) to 200, to prevent unexpected :)
(Setq kill-ring-max 200)
; Set the default mode to text instead of basic mode.
(Setq default-Major-mode 'text-mode)
; Set the tab to the width of four spaces, instead of the original 2
(Setq default-tab-width 4)
(Add-hook 'text-mode-call' turn-on-auto-fill)
(Setq user-full-name "Lichuang"
(Global-font-lock-mode t)
; The following setting allows the cursor to show matching parentheses when pointing to a bracket.
(Show-Paren-mode t)
(Setq show-Paren-style 'parentheses)
; Set the C language style to K & R
(Add-hook 'C-mode-hook
'(Lambda ()
(C-set-style "K & R "))