Bob KellerÕs Emacs Guide

 

You will find numerous emacs help pages at various places and there are also some commercial books on it. Below IÕve tried to distill the commands and tips that I personally find the most useful.

 

Notation

C-

means hold down the Control key while pressing the key indicated

M-

means hold down the Meta key while pressing the key indicated,

OR press
the escape key before pressing the key indicated.

M-C-

means hold down both the control and meta keys

OR press escape, then the indicated key with control.

 

(The meta key is the same as the alt on NCDÕs and PCs and the same as the command or apple key on Macintoshes.)

(Note the fundamental difference: You do not hold the escape key, you press it before.)

 

An alternative to escape which sometimes requires less of a reach is C-[. I use this a lot.

 

Text typed without C- or M- is entered literally as is. My frequently-used commands follow.


 

 

Command

Meaning

C-f

move Forward one character.

C-b

move Backward one character.

C-n

move to the Next line.

C-p

move to the Previous line.

M-f

move Forward one word.

M-b

move Backward one word

M-C-f

move Forward one parenthesized expression.

M-C-b

move Backward one parenthesized expression.

C-a

move to the beginning of the current line.

C-e

move to the End of the current line.

M-<

move to the beginning of the buffer.

M->

move to the end of the buffer.

C-v

scroll to the Next page.

M-v

scroll to the Previous page.

C-d

Delete the next character.

M-d

Delete the next word.

C-o

Insert blank line.

C-k

Kill (delete) the current line from the cursor on.

C-y

Yank (paste) the most recent kill at the current point.

M-y

(after C-y) Yank (paste) the previous kill at the current point (cycles backward).

C-s

Search forward.

C-r

Search in reverse.

C-x C-f

Find file (prompts for name); will create new file if non-existent.

C-x C-c

Save current file.

C-x C-w

Write file (prompts for name).

C-x u

Undo previous edit (can be used multiple times).

C-x b

Display list of Buffers (select one by typing f on line, then hit return).

C-x 2

Split buffer into two buffers.

C-x o

Switch to the next (ŌotherĶ) buffer.

M-x shell

Create Shell buffer in the current window.

C-z

Suspend emacs. Use fg to restart.

C-x C-c

Kill emacs.

C-x (

Start keyboard macro.

C-x )

End keyboard macro.

C-x e

Execute keyboard macro.

M-x help-with-tutorial

M-x apropos

Information on a given topic.

M-x set-mark

Set mark (to create a region between the mark and the cursor).

C-w

Kill text in region (between the mark and the cursor).

M-x fund

Set to fundamental mode (no special formatting).