Emacs Help
For CS16 Lab01


Starting emacs

To bring up emacs to make changes to ctof.c, type:

emacs ctof.c

This may bring up a new window where you can edit this program.

Do I have to use emacs?

If there is another program that you prefer, e.g. vim, that is already available on the Cooper Lab (and CSIL) computers, and you already know how to use it (or are willing to take responsibility for learning how) that's fine. So, no, you don't have to use emacs, specifically. However you will need to learn some editor that works on the lab computers. Working only on your own PC or Mac at home will not be sufficient.

By the way, knowing how to use either vi/vim or emacs is really a kind of a "basic skill" that every software developer should have in his/her toolkit. So if you don't already know one of those editors, now is as good a time as any to start learning one of them.

Some emacs commands

Here are a few emacs commands that may be helpful to know.

Remember that:

C-x is called "control-X" and means "hold down the control or Ctrl key while typing the letter x"
C-x 1 means "type control-X, then type the number 1".
C-x C-c means "type control-X then type control-C".

Keystroke Command
C-x 1 If there are multiple windows, get rid of the other ones.
I only want the one the cursor is in right now.
Arrow Keys Used to move around
Delete/Backspace Deletes the previous character
C-d Deletes the character immediately under the cursor
C-x C-w Save As
C-x C-s Save
C-x C-c Exit emacs (it will ask if you want to save)
C-g Cancel current command ("get me out of trouble")
C-k Kill (delete) the current line

An emacs reference

Here's a link to a PDF File with lots more emacs commands—it is suitable for printing on a single sheet of paper (front and back) and having handy while you work in emacs.