Note that ^ means the CONTROL key.
So ^X means: hold down the CONTROL key while typing X
Some commands require two separate keypresses. For example:
^X^F means type Control-X then type Control-FESC F means type the Esc key then type the F key.
Do NOT hold down the Esc key while typing F!
| To start emacs in an X-Term window | emacs filename
& | |
| To save all files and close down emacs when finished | ^X^C (then Y
| (or use File menu) |
| To read in (Find) a file | ^X^F
| (or use File menu) |
| To Save the current file (and continue editing) | ^X^S
| (or use File menu) |
| To save (Write) the file and give it a different name | ^X^W
| (or use File menu) |
| To save all files and close down emacs when finished | ^X^C
| (or use File menu) |
| To move the cursor Forwards one space | ^F
| (or use Arrow key) |
| To move the cursor Forwards one word | Esc F
| (or use ^ with Arrow key) |
| To move the cursor Backwards one space | ^B
| (or use Arrow key) |
| To move the cursor Backwards one word | Esc B
| (or use ^ with Arrow key) |
| To move the cursor to StArt of current line | ^A
| |
| To move the cursor to End of current line | ^E
|
| To move the cursor to the Next line | ^N
| (or use Arrow key) |
| To move the cursor to the Previous line | ^P
| (or use Arrow key) |
| To moVe the cursor to the next page | ^V
| (Or use Scroll Bar) |
| To moVe the cursor to the previous page | Esc V
| (Or use Scroll Bar) |
Note that as text is deleted, emacs automatically saves it into a paste buffer.
This means that it can be easily recalled by using the Yank back (or
paste) command ^Y. Since each deletion has its own paste
buffer, it is possible to recall text that was deleted some time ago. Just type
^Y followed repeated by repeated Esc Y's until the
desired text appears.
| To Delete char under cursor (delete forwards) | ^D
| |
| To delete char before cursor (delete backwards) | DEL
|
| To Delete word under cursor (delete forwards) | Esc D
| |
| To delete word before cursor (delete backwards) | Esc DEL | |
| Kill line from cursor (to the end of line) | ^K
| |
| Yank back (paste) contents of current paste buffer | ^Y
| (Or use Middle mouse button) |
| Retrieve contents of previous paste buffer (emacs only) | ^Y followed by Esc Y Esc
Y... | |
Any part of the text can be set as the "Region", using the mouse or the keyboard. Once the region has been set, then there are a number of editing commands that apply to it.
When the mouse is used to set the region, then the appropriate area of text is shown highlighted; this does not happen when the keyboard is used.
| Set the region using the mouse. (The appropriate text is highlighted) | Hold left button and drag mouse
|
| Set the start of the region using the keyboard (emacs only).
The region is the text between mark and cursor (not highlighted) | ^@ or ^space |
| Kill region (Wipe it out) and copy to paste buffer | ^W
| |
| Copy region to paste buffer but do not delete it | Esc W
| |
| Paste (Yank back) previously saved text | ^Y
| (emacs: Or use Middle mouse button) |
emacs allows you to edit several files at once. Each file is allocated its own area of memory, called a "buffer".
| To read in (Find) a file and load it into a buffer | ^X^F
| (or use File menu) |
| Switch to another buffer (file) | ^X B
| (Better: use Buffers or Windows menu) |
| List Buffers currently in memory (emacs only) | ^X^B
| (Better: use Buffers menu) |
emacs also allows you to split its window into two parts (upper and lower). This means you can:
| Split the emacs window into 2 parts | ^X 2
| (Or use Files menu) |
| Unsplit the window (make this the only 1) | ^X 1
| (Or use Files menu) |
| Switch to buffer in the other window | ^X O
| (Better: Point and Click) |
| Change a whole word into Upper case | Esc U
|
| Change a whole word into Lower case | Esc L
|
| Make first letter of a word into a Capital | Esc C |
| Reformat a whole paragraph of text Don't try this on Java programs! | Esc Q
| |
| Abort a command whilst it is executing | ^G
| |
| UNDO previous edit(s) in emacs | CTRL SHIFT -
| (or use Edit menu)
|