Emacs Principles, Command and Keys

By Xah Lee. Date: . Last updated: .

Everything is a Command

In emacs, every keystroke executes a command. For example, when you type a key e, emacs actually runs the command self-insert-command.

Any key or key combination sequence you press ultimately calls a command.

There are over 3 thousand commands in emacs by default.

Most commonly used commands have a keyboard shortcut, such as moving the cursor, opening file, copy paste, close a file, search text.

To run a command by name, type Alt+x followed by the command name.

execute-extended-commandAlt+x
Execute a command by name
keyboard-quitCtrl+g
Cancel a command in progress, or cancel unfinished keyboard keystroke sequence

Find What a Key Do

describe-keyCtrl+h k
Prompt to type a key shortcut, then show command name and doc bound to that key.

Find a Command's Key

describe-functionCtrl+h f
Prompt to type a command name, it'll shows the command's key, if any.

How to find a command

Alt+x apropos-command
Search command by name.

View Current Major Mode's Documentation

Alt+x describe-mode
Show current major mode's documentation.
ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Tutorial

Quick Start

Manage Windows

File

Buffer

Find Replace

Copy/Paste

Unicode

Whitespace

Rectangle Edit

Line Wrap

Shell

View Special File

Editing Brackets

Org Mode

HTML

Emacs Efficiency

Misc