Emacs survival guide

These directions were tested on GNU Emacs 20.5.1 and Red Hat Linux 6.2.

Last revised January 9, 2000. Use your browser's Reload or Refresh button to get the latest version.


Notation

Emacs uses the control key and escape key heavily. We write it like this:

C-x Pronounced "Control-x"
Hold down the Ctrl key (usually in the lower left corner of the keyboard) while pressing the x key.
Both Ctrl and x must be down at the same time.
M-x Pronounced "Meta-x"
Press the Esc key (usually in the upper left corner of the keyboard), release it, then press the x key.
Esc and x should not be down at the same time.

So C-x C-f means hold down the control key, then type x and then f while holding it down. (This is the command to load a file into emacs).

Starting

To start Emacs, type one of these commands in a terminal window at the Unix prompt:

emacs

Starts emacs in a new window, possibly with different font, etc. However you can't use that terminal window until you exit emacs.

emacs &

Starts emacs in a new window, releases control of your terminal window

emacs test.txt

Starts emacs in a new window, loads the file test.txt (if it doesn't exist, creates a new empty file). Alternatively, you can load the file later. See below.

emacs -nw

Starts emacs in the same terminal window.
Use this form to keep the same font etc., or if system complains about X, privileges, or just because.

emacs -fg black -bg gray73 -fn *-fixed-*-20-* -geometry 80x28

Starts emacs in a new window with the specified foreground color, background color, font, and window size.

Typing

Just type. All the regular keys, arrow keys, delete, backspace, and page up/down keys should work. Alternatively, you can try these commands: C-f cursor forward, C-b cursor back, C-p previous line, C-n next line, M-v page up, C-v page down.

Exiting

Type C-x C-c. If you have any unsaved work, emacs will ask you if you want to save it. Type y.

Other commands

Most control or escape sequences are commands. Usually a prompt appears in the command line at the bottom of the window. Here are a few:

C-x C-fLoad file, prompt for filename
C-x C-sSave file without exiting
C-x C-cExit, prompt to save files
C-sSearch forward, prompt for search string
C-rSearch backward, prompt for search string
C-h ?Show help options, prompt for choice
C-h tStart emacs tutorial

If you make a mistake or change your mind you can always escape:

C-gAbandon command and resume typing


Jon Jacky, jackyj@evergreen.edu