WSU logo


College of Engineering & CS
Wright State University
Dayton, Ohio 45435-0001

CEG 333: Introduction to Unix

Prabhaker Mateti

Emacs: Prefix Arguments


Key Meaning
C-u Begin entering a prefix argument.

Many Emacs commands take a prefix argument. These tell the command how many times to do something or invoke an alternate behavior. To enter a prefix argument, use C-u before the command.

For example, C-u 1 3 C-f moves the cursor right 13 times. That's "control u", then the numerals "1" and "3", followed by C-f (which is equivalent to the right arrow key).

An example of the other use of prefix args is setting the mark. Normally C-SPC sets the mark and starts a region. But C-u C-SPC stops marking and jumps to the start of the last region.

When C-u is used without numbers after it, the prefix arg takes on the default value. The numeric value of this default is four, so a plain C-u C-f moves the cursor four characters. Additional C-u's are multiplicative, raising the previous argument value to the power of the new one. (C-u C-u C-u C-f moves 64 characters.