UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 6.4 Examples of SearchingChapter 7Next: 7.2 Summary of Commands by Group
 

7. The Emacs Editor

Contents:
Introduction
Summary of Commands by Group
Summary of Commands by Key
Summary of Commands by Name

This section presents the following topics:

7.1 Introduction

Although emacs is not part of SVR4 or Solaris 2.0, this text editor is found on many UNIX systems because it is a popular alternative to vi. Many versions are available. This book documents GNU emacs, which is available from the Free Software Foundation in Cambridge, Mass. For more information about emacs, see the Nutshell Handbook Learning GNU Emacs.

To start an emacs editing session, type:

emacs [file]

On some systems, GNU emacs is invoked by typing "gmacs" instead of "emacs."

7.1.1 Notes on the Tables

Emacs commands use the Control key and the Meta key (Meta is usually the ESCAPE key). In this section, the notation C- indicates that the Control key is pressed at the same time as the character that follows. Similarly, M- indicates the use of the Meta key. It's not necessary, however, to keep the Meta key pressed down while typing the next key.

In the command tables that follow, the first column lists the keystroke and the last column describes it. When there is a middle column, it lists the command name. This name is accessed by typing M-x followed by the command name. If you're unsure of the name, you can type a space or a carriage return, and emacs will list possible completions of what you've typed so far.

Because emacs is such a comprehensive editor, containing hundreds of commands, some commands must be omitted for the sake of preserving a "quick" reference. You can browse the command set by typing C-h (for help) or M-x (for command names).

7.1.2 Absolutely Essential Commands

If you're just getting started with emacs, here's a short list of the most important commands to know:

C-h

Enter the online help system.

C-x C-s

Save the file.

C-x C-c

Exit emacs.

C-x u

Undo last edit (can be repeated).

C-g

Get out of current command operation.

C-p

Up/down/forward/back by line or character.

C-n

C-f

C-b

C-v

Forward/backward by one screen.

M-v

C-s

Search for characters.

C-d

Delete a character.


Previous: 6.4 Examples of SearchingUNIX in a Nutshell: System V EditionNext: 7.2 Summary of Commands by Group
6.4 Examples of SearchingBook Index7.2 Summary of Commands by Group

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System