Ugly Quick Reference Guide to EMACS

This document contains a rudimentary set of commands. Note that if you use emacs on the Linux instructional machines, editing a file ending in ".C" will put you into C++ mode in emacs. In this mode, pressing the TAB key on any line will indent it in a reasonable fashion.

The ^ character stands for the ctrl key on your keyboard. The M character stands for the esc key on your keyboard. It used to stand for the meta key, but they don't make keyboards with that key anymore.

emacs file To open a file in emacs.
^h To get help
^h t To get a brief Emacs tutorial
^x^c To leave emacs, saving the current file
^x^s To save the current file without leaving emacs. Also notice that emacs has an autosave feature.
uparrow or ^p move up a line
downarrow or ^n move down a line
rightarrow or ^f move forward one character
leftarrow or ^b move backwards one character
Mf move to end of string
Mb move to beginning of string
Mv move up a screen
^v move down a screen
^e move to end of line
^a move to beginning of line
M< move to beginning of document
M> move to end of document
^k kill text from cursor position to end of line (store in buffer)
^y yank back text from buffer, insert in current position. You can kill several lines at a time, they all go into the buffer and can then be yanked back.
^g kill current command
^l recenter text, refresh screen
^s search forward
^r search backwards