Introduction to Emacs
The easiest way is
to type "emacs &" in a shell.
There are two special keys that you will find yourself using over and
over in Emacs. They are:
- the "control" key
is easy to find -- it's the key with "control" written
on it. The control key is usually notated C-, so the
notation C-x
means "hold down the control key and press x".
- the "meta" key is usually located near the space bar -- it's the
button with the diamond on top. The meta key is notated M-, so
M-x means "hold down the meta key and press x"
Just type some stuff. It will insert it.
C-x C-c
Usually the arrow keys and page-up/down keys will work as you would
expect them to in Emacs. However, if they don't, you can always use
these commands:
C-v Go down one page
M-v Go up one page
C-f Move forward (right) one character
C-b Move backward (left) one character
C-n Move to the next line
C-p Move to the previous line
MORE ADVANCED CURSOR CONTROL
|
If you really like moving around in Emacs, here's some more key
bindings for you:
M-f Move forward a word
M-b Move backward a word
C-a Move to beginning of line
C-e Move to end of line
M-a Move back to beginning of sentence
M-e Move forward to end of sentence
M-< Go to beginning of file
M-> Go to end of file
Here are the basic commands you need to load and save files:
- To view the name of the current file, look near the bottom of the
Emacs screen.
- To load a file: type C-x C-f. This puts you in a mini-buffer in which
you type the filename of the file you want to load. When you are
finished typing the filename, hit . Do NOT use the mouse to
get out of the minibuffer.
- To save a file: type C-x C-s.
Save often in case your computer crashes.
- To create a file: Type C-x C-f as if you were loading an already
existant file, and type the filename of the new file. Emacs will
create the new file when you save it.
- To save a file to a new name: Type C-x C-w, and then type the new
filename, followed by a return.
There are several ways to find help in Emacs:
C-h t runs the tutorial
C-h k describe key (long)
C-h c descibe key (short)
C-h C-h C-h more info
Listed below are some assorted commands that you may find useful for
editing documents:
Text deletion commands
DEL delete the character just before the cursor
C-d delete the next character after the cursor
M-DEL kill the word immediately before the cursor
M-d kill the next word after the cursor
C-k kill from the cursor position to end of line
Whoops! (How to undo commands)
C-_ (or C-x u) Undo last change.
C-u 10 C-_ Undo 10 last changes.
C-g Abort a partially typed or executing command
M-x recover-file Use this as a last resort to recover a lost file
Inserting text
C-x i Inserts a file into the buffer
Searching for stuff
M-x goto-line This jumps to a specified line in the file
(useful for debugging)
C-r,s Search backwards and forwards in the file for pattern
Fun stuff
M-x hanoi
M-x doctor
If you're insterested in learning more about emacs, you can try looking
at these sites:
CS103