3.1. Introduction

Emacs is a powerful text editor that can run directly inside the terminal. It allows us to read and write source code and other text documents without ever having to leave the command-line environment. While you are welcome to explore other text editors available in a Unix environment, we focus on GNU Emacs in this course.

Why Emacs?

Why do we use Emacs in CSCI 1302? Here is Dr. Cotterell's perspective:

Emacs works in the terminal; therefore, working with it will build and strengthen your skills in a Unix-like environment. With respect to Java, it allows you to focus on really learning the syntax of the language, which means you won't have to rely on the editor to write a program (e.g., we want to avoid, "I can only write Java in editor X"). Furthermore, if you go back to using a more advanced editor, then you'll be able to make informed decisions regarding suggestions the editor provides instead of accepting them as "must do."

—Dr. Michael E. Cotterell

3.1.1. What to Expect

In this chapter, you will learn the core fundamentals of the Emacs text editor:

  • Reading Control (C-) and Meta (M-) modifier key notations.

  • Creating and opening files from the command line and from within Emacs.

  • Navigating text without taking your hands off the home row.

  • Editing, deleting, undoing, copying, pasting, and searching text.

  • Managing multiple files simultaneously using split windows and buffers.

  • Launching the built-in interactive Emacs tutorial (C-h t).

You will be using and practicing with Emacs throughout the semester. We do not expect you to memorize every shortcut immediately. We recommend referencing the Basic Commands section and keeping a cheat sheet handy while coding.

If you want to explore additional commands, consult the GNU Emacs Reference Card. To learn more about the history and extensive capabilities of Emacs, visit its official website or Wikipedia page.