3.1. Introduction¶
Emacs is a powerful text editor that can run in the terminal. It allows us to read and write source code (and any other text documents) without having to leave our terminal environment. While you are welcome to use other text editors that are available in a Unix environment, we will focus on Emacs in this course.
Why Emacs?
Why do we use Emacs in CSCI 1302? Here is Dr. Cotterell’s usual response to that question:
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.”
In this chapter, you will learn the basics of the Emacs text editor. Since you will be writing and editing Java code in Emacs, it’s important to know the basic shortcuts. We don’t expect you to memorize all of these shortcuts at this time. Instead, just try to get a basic understanding of how Emacs works. You will be practicing with Emacs all semester. We also recommend printing the Basic Commands and having them next to you while coding - especially for the first month or two of the course.
If you want to learn additional commands, please refer to the Emacs Reference Card
Note
If you’re interested in learning even more about Emacs than what is provided in this chapter, then we encourage you to refer to its official website or its Wikipedia page.