CSCI 235: Emacs tips

Dealing with headaches

The "get-me-out-of-this-action" key is ^G.

Sometimes, if you are mixing mouse navigation with typing, you might leave a command uncompleted, which makes some wierd things happen. If that's the case, you'll see the command named on the bottom line of the window, below the status bar. To deal with that situation, click your mouse in there (so that your typing will go to the command), then either finish the command or abort it with ^G.

Of mice and menus

If you use the buttons or menus for opening and writing files, you need to know that the dialogs that pop up are written for a three-button mouse. In particular, when you are opening a file, middle-clicking on a file name will select it. The scroll wheel doubles as the middle button: you can click it.

Some useful key sequences

Emacs uses a few keys (such as ^X or ESC) as prefixes to other keys, instead of like a shift key. So some of these are multiple-key sequences.

^X ^FOpen (find) a file. (You'll complete the filename on the bottom line of the screen.)
^X ^SSave the current file.
^X ^WWrite the current file under another name. (You'll complete the filename on the bottom line of the screen.)
^KKill from the cursor to the end of the line. If you hit this several times in a row, what you kill will all be collected together.
^YYank back whatever was last killed.
^WKill (wipe) the highlighted text.
^AMove to the beginning of the line.
^EMove to the end of the line.
ESC g gGo to a line by number.

Displaying line numbers

Emacs is already set to show you what line number the cursor is on, which can be helpful for finding and fixing mistakes. The line number shows up toward the right side of the status bar below the text you are editing, as something like L23 to indicate that you are on line 23.


Cary Gray

Last modified: Mon Sep 9 11:07:35 CDT 2013

Valid HTML 4.01!