Emacs Editing
100%

Advanced Text-Fu · Lesson 12

Emacs Editing

Learn how to move point, activate a region, and use Emacs kill-ring commands to edit text.

Emacs calls the current cursor position point. Movement commands reposition point; editing commands insert, delete, kill, copy, or yank text around it. In the key notation below, C- means Control and M- means Meta, commonly Alt.

Moving by Characters and Lines

Arrow and other platform navigation keys may work, but Emacs's standard movement commands remain available across terminal and graphical sessions:

  • C-f: Move forward one character.
  • C-b: Move backward one character.
  • C-n: Move to the next line.
  • C-p: Move to the previous line.
  • C-a: Move to the beginning of the line.
  • C-e: Move to the end of the line.

Which Emacs key moves point to the next line?

Moving by Words and Buffer Boundaries

Meta commands move across larger units:

  • M-f: Move forward one word.
  • M-b: Move backward one word.
  • M-<: Move to the beginning of the buffer.
  • M->: Move to the end of the buffer.

On many keyboards, Alt acts as Meta. When that chord is unavailable, pressing Esc and then the following key often sends the equivalent Meta command.

Which Emacs key moves point to the end of the buffer?

Defining a Region

The mark is a saved buffer position. The text between point and mark is the region. Press C-SPC, written C-space in some documentation, to run set-mark-command, then move point to extend the active region.

In a terminal, C-SPC can be encoded as C-@. Highlighting depends on transient-mark settings, but point and mark still define a region.

Which key begins defining a region by setting the mark at point?

Killing or Copying a Region

Emacs stores killed and copied text in the kill ring:

  • C-w: Kill the active region, removing it and adding it to the kill ring.
  • M-w: Copy the active region to the kill ring without removing it.
  • C-k: Kill from point to the end of the line; repeated use can include the newline.

Killing is more than ordinary deletion because the removed text is retained for later yanking.

Which key copies the active region to the kill ring without removing it?

Yanking from the Kill Ring

Use C-y to yank the most recent kill-ring entry at point. Immediately after a yank, M-y replaces that inserted text with an earlier kill-ring entry; repeating M-y cycles through entries.

C-y
M-y

If another unrelated command occurs after C-y, M-y no longer has the same yank-pop context.

Which key inserts the most recent kill-ring entry at point?

Practice in *scratch* or a disposable file: move point, set the mark, copy one region, kill another, and yank both back. Save only when the resulting file is worth keeping.

Lesson complete

You finished Emacs Editing

You can now navigate and rearrange Emacs text using point, mark, and the kill ring.

  • Move by characters or lines with Control commands.

  • Move by words or buffer boundaries with Meta commands.

  • Set the mark with C-SPC to define a region.

  • Kill with C-w or copy with M-w.

  • Yank with C-y and cycle with M-y immediately afterward.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Advanced Text-Fu