Sams Teach Yourself Emacs in 24 Hours |
||||||||||||||||||||
Hour 3: Getting Started with Emacs |
||||||||||||||||||||
|
You have already seen that both the Control key and the Meta key are used in Emacs (C-x b.to go to another buffer and M-x to type commands in the minibuffer). There seems to be a general plan about where what is located. It is very useful to be aware of this plan; therefore, here it comes:
All letters, numbers, and symbols on the keyboard insert the label given on the key, if pressed without Control or Meta.
All functions that are used very often are available with either the Control or Meta key pressed down. (For example, Go to End of Line is bound to C-e, Undo is bound to C-_, and Paste is bound to C-y.)
If the Control prefix is bound to a function that works on characters for a given key, the Meta prefix works on words (if this gives any meaning for the given function). Likewise if the Control prefix works on lines, the Meta prefix works on sentences. Examples of this include C-t, which transposes two characters, whereas M-t transposes two words. C-e moves point to the end of the line, whereas M-e moves point to the end of the sentence.
Functions that are used less often are bound with the prefix C-x. Examples of this include C-x C-c, which exits Emacs, and C-x 2, which splits the window in two, with a buffer in each one.
Functions that are specific to a given mode are prefixed with C-c.
Functions that aren't often used or which should not be bound on the keyboard are not bound at all, but are accessible by pressing M-x and typing the name of the function.
The prefix C-x 4 is reserved to functions that operate on another window. Examples include opening a file in an other window, which is bound to C-x 4 C-f (find-file-other-window). Likewise, C-x 5 is the prefix for functions that operate on another frame. C-x 5 C-f (find-file-other-frame) opens a file in another frame. Note how these two functions have the same keybinding as C-x C-f (find-file) with the exception of the letter 4 or 5 inserted in the middle. (This is not a coincidence!)
Sams Teach Yourself Emacs in 24 Hours |
||||||||||||||||||||
Hour 3: Getting Started with Emacs |
||||||||||||||||||||
|
© Copyright Macmillan USA. All rights reserved.