Catalog / Emacs Cheatsheet

Emacs Cheatsheet

A comprehensive guide to Emacs, covering essential commands, navigation, editing, buffers, windows, and customization.

Basic Navigation

Cursor Movement

C-f

Move cursor forward one character.

C-b

Move cursor backward one character.

C-n

Move cursor to the next line.

C-p

Move cursor to the previous line.

M-f

Move cursor forward one word.

M-b

Move cursor backward one word.

C-a

Move cursor to the beginning of the line.

C-e

Move cursor to the end of the line.

Scrolling

C-v

Scroll forward one screen.

M-v

Scroll backward one screen.

C-l

Center current line on screen.

Going to specific locations

M-<

Go to the beginning of the buffer.

M->

Go to the end of the buffer.

M-g g

Go to a specific line number.

Editing

Basic Editing Commands

C-d

Delete character at point (cursor).

DEL

Delete character before point.

M-d

Delete word after point.

M-DEL

Delete word before point.

C-k

Kill (cut) to end of line.

M-k

Kill (cut) to end of sentence.

C-y

Yank (paste) last killed text.

M-y

Replace yanked text with previously killed text.

C-w

Cut the selected region.

Working with Regions

C-@ or C-SPC

Set mark at point.

C-x C-x

Exchange point and mark.

Indentation

M-i

Indent current line (TAB).

C-j

Newline and indent.

M-m

Indent current line like the previous line.

Buffers and Files

Buffer Management

C-x C-f

Find file (open file).

C-x C-s

Save file.

C-x C-w

Save file as.

C-x i

Insert file into current buffer.

C-x b

Switch buffer.

C-x k

Kill buffer (close buffer).

C-x C-q

Toggle read-only status of buffer.

Working with Multiple Buffers

C-x C-b

List buffers.

Windows and Frames

Window Management

C-x 2

Split window horizontally.

C-x 3

Split window vertically.

C-x o

Switch to other window.

C-x 0

Close current window.

C-x 1

Make current window the only one.

C-x +

Increase window height.

C-x -

Decrease window height.

Frame Management

C-x 5 2

Create new frame.

C-x 5 o

Switch to another frame.

C-x 5 0

Delete current frame.