Emacs Binding
- C-x C-c: Shut Down;
- C-g: quit a command (keyboard quit);
- C-v: next page; M-v: previous page; C-x ]: forward page; C-x [: backward page;
- C-l: Clear screen and redisplay all the text, moving the text around the cursor to the center of the screen.
- C-p: previous line; C-n: next line; C-f: forward; C-b: backward;
- M-f: move forward a word; M-b: move backward a word; M-{, M-}: move through a whole paragraph;
- C-a: move to the beginning of the line; C-e: to the end of line; M-a: to beginning of sentence; M-e: to end of sentence;
- M-<: beginning of buffer; M->: end of the buffer;
- C-u 8 C-f: move forward 8 characters. C-u 9 C-b: move backward 9 characters; "M- n + command" repeat command n times. C-u + command, repeat command 4 times.
- C-u 8 C-v: scrolls the screen by 8 lines;
- C-x 1: expands the window which contains the cursor, to occupy the full screnn. It deletes all other windows.
- C-u 8 *: to insert ********;
- C-d: Delete the next character; M-<DEL>: Kill the word immediately before the cursor; M-d: Kill the word after the cursor; C-k: kill from the cursor to end of line; M-k: kill to the end of the current sentences. C-x <Del> delete previous sentense.
- Move the cursor to some starting character, then type C-<SPC>, then go the the end point, then type C-w, kill all text between them.
- C-u 2 C-k: kills 2 line and their contents, while C-k twice just kills the content and the line.
- C-y: pasting what you cut, C-k is the cut binding;
- If you do several C-k's in a row, all of the killed text is saved together, so that one C-y will yank all of the lines at once.
- M-y: when you killing something, they are in the memory, then you C-y(yanking), when you type M-y, you can choose which one you want to bring back.
- C-/: undo; other undos: C-_; C-x u;
- C-x C-f: find a file with an argument, which is the file name; C-x C-v: find an alternate file. C-x i: to inserting or appending a file to the point where the cursor is.
- C-x C-s: Save the file; C-x C-w: Save as.
- C-x C-b: List buffers;
- C-x b: switch to a buffer with a name;
- C-x s: save some buffers, you will answer y or n.
- C-z: exit Emacs temporarily.
- replace string: M-x replace-string, just type repl s<TAB> is ok;
- Auto Save: Emacs auto saves your file with # at the beginning and end of the file name, such as:#hello.c#, when you save it normally, Emacs will delete it.
- Recover a file: M-x recover-file.
- M-x fundamental-mode: to switch to fundamental mode;
- M-x text-mode: switch to text mode;
- C-h m: view documentation of your current major mode;
- M-x auto-fill-mode<Return>: turn on auto fill mode(minor mode);
- C-x f: set the fill column; C-u 20 C-f: set the column to 20;
- in a paragraph, M-q do the refill job.
- C-s: search something, type C-s again, move forward to the string you search, Del to go back, return to terminate the search. C-r: search backward.
- C-x 2: splits the frames into 2 windows; C-x o: change the cursor between windows;
- C-M-v: scroll the other window;
- M-x make-frame, M-x delete-frame: open another frame, delete ...;
- <ESC><ESC><ESC>: getting out of recursive editing mode, and getting out of minibuffer and so on.
- C-h ?: get help; M-x help; C-h f previous-line<Return>: help for C-p;
- use C-h k instead of C-h c to get more information about a command.
- C-h i: *infor* buffer; C-h r;
- M-x refill-mode; M-x auto-fill-mode;
- M-q: fill paragraph command;
- M-x paragraph-indent-mode; M-x fill-region;
- C-q C-l: insert page delimiter in text mode;
- Mark: C-<Space> or C-@; remember use C-x C-x to check starting point and ending point. M-w: copy the marked region. To cut the region, press C-w. C-y: after C-y, pastes earlier deletion. Mark a paragraph: M-h; Mark the current page: C-x C-p; Mark the whole buffer: C-x h.
- M-x set-variable (enter) kill-ring-max (enter) new-value (enter): to set the max kill ring save number(30 by default).
- C-t: transpose two letters, M-t: (between 2 words) transpose two words. C-x C-t: (cursor in the second line) transpose the two line.
- M-c: (pointer at the first letter of a word) capitalize it. M-l: put the word in lower case. M-u: in uppercase. M-(hyphen) preceding your command, it will change the left part of the word.
- Overwrite mode(minor mode): M-x overwrite-mode (enter).
- Reverting a Buffer from a file: M-x revert-buffer (enter).
- Auto-saved file: "text.xx~", backup file: "#text.xx#", M-x recover-file (enter) to recover text from an auto-saved file.
- C-x k: delete a buffer. M-x kill-some-buffers: Emacs ask you whether or not to kill each of your current buffers.
- C-x 2: split window vertically. C-x 4 f: find a file on another window. C-x 4 b: to select a different buffer in another window. C-M-v: scroll other window.
- C-x 0: delete the window you're in. C-x 1: delete the windows except the one you're in. M-x delete-windows-on (enter) buffername (enter): delete all windows on a certain buffer.
- C-x 5 2: create a new frame. C-x 5 f + filename: create a new frame with another file. C-x 5 b: switch to a buffer in a new frame. Move between frames: C-x 5 o. Delete a frame you are in: C-x 5 0. C-z: minimize a frame. C-x 5 r: finds a file in a new frame, but it is read-only.
- C-x C-s: save buffer; C-x s: save some buffers. type y to save, n to discard. ! to save all without asking. "." to save this buffer and no more. then press C-r to view mode, q to quit.
- C-x }: enlarge the windows; also see C-x ^;
- If you want automatic indentation, try to use
C-j
instead ofRET
for a while.C-j
usually runsnewline-and-indent
. - f
- f
- f