CMSC 201

Lab 1: Introduction to Unix and Emacs

Emacs

To write our programs, we'll be using the text editor emacs. To open emacs, simply type "emacs &" into the command prompt. Emacs has a fairly complicated interface, and responds to a specific set of keystrokes. Some useful ones:

  1. ctrl-x ctrl-c quits the program
  2. ctrl-x ctrl-s saves the current file
  3. ctrl-x ctrl-f someFilename opens someFilename in the text editor. If it doesn't exist, emacs creates the file.
  4. ctrl-k deletes the line immediately after the cursor
  5. ctrl-y brings the line back
  6. ctrl-a goes to the start of the line
  7. ctrl-e goes to the end of the line

You can find a more complete list here.