These tables follow the GNU Emacs Reference Card for Emacs 31.1 section by section; one keymap serves every system. The card's notation is written out: C-x C-s becomes Ctrl + X, Ctrl + S, two chords in turn. M- is the Meta key, Alt on most keyboards and Option on a Mac; Esc, then the key, does the same. Commands without a key appear as Alt + X plus their name; the regular-expression rows are typed text, not keys.
The card prints keys in Emacs notation and states the rule used on this page: C-x is Ctrl + X, M-x is usually Alt + X, S-x is Shift + X and C-M-x is Ctrl + Alt + X. Keys the card separates with a space (C-x C-s) are pressed one after the other, shown here with a comma.
M- stands for Meta, the key usually labeled Alt. Any Alt chord can also be typed as two keys: press Esc, release it, then press the key, so Esc followed by F does the same as Alt + F. This helps in terminals that do not pass Alt through.
On macOS the Option key, like Alt, acts as Meta by default, so the Alt rows are typed with Option. Cmd is a different modifier (Super) that no binding on the card uses.
Action
Shortcut
Open a filePrompts for a name in the minibuffer and shows the file in a buffer, which is called visiting it.
Ctrl+XthenCtrl+F
Save the bufferWrites the current buffer to the file it is visiting.
Ctrl+XthenCtrl+S
Save all modified buffersAsks, buffer by buffer, whether to write each one that has unsaved changes.
Ctrl+XthenS
Insert a fileCopies another file's text into the current buffer at the cursor, without visiting that file.
Ctrl+XthenI
Visit a different fileKills the current buffer and opens the file you name in its place, for when the wrong one was opened.
Ctrl+XthenCtrl+V
Save as another filePrompts for a file name, writes the buffer there and visits that file from then on.
Ctrl+XthenCtrl+W
Toggle read-onlySwitches the current buffer between read-only and writable.
Ctrl+XthenCtrl+Q
Switch to another bufferPrompts for a buffer name with completion; an unused name creates a new empty buffer.
Ctrl+XthenB
List buffersOpens a window listing every buffer with its size, mode and visited file.
Ctrl+XthenCtrl+B
Kill a bufferPrompts for the buffer to close, defaulting to the current one, and asks first if it has unsaved changes.
Ctrl+XthenK
Minimize or suspend EmacsMinimizes the frame on a graphical display; in a text terminal it suspends the program and returns to the shell.
Ctrl+Z
Quit EmacsOffers to save each modified file buffer first, then ends the session.
Ctrl+XthenCtrl+C
Getting help 8
Action
Shortcut
Open the help systemA prefix key: the character typed next chooses what kind of help to show.
Ctrl+HorF1
Start the tutorialOpens the interactive lesson the card recommends to first-time users.
Ctrl+HthenT
Close the help windowMakes the window you are editing fill the frame again; the same command as in Multiple windows.
Ctrl+Xthen1
Scroll the help windowScrolls the other window, so help text can be read without leaving the buffer being edited.
Ctrl+Alt+V
Search commands by keywordLists every command whose name matches the word or regexp you type.
Ctrl+HthenA
Describe a keyPress any key sequence afterwards to read the documentation of the command bound to it.
Ctrl+HthenK
Describe a functionPrompts for a function or command name and shows its documentation in a help window.
Ctrl+HthenF
Describe current modesDocuments the major mode and the active minor modes, including their special key bindings.
Ctrl+HthenM
Error recovery 5
Action
Shortcut
Cancel a commandStops a running command, or discards a half-typed key sequence or numeric argument.
Ctrl+G
Recover a crashed sessionLists interrupted sessions and restores their files from the auto-save data.
Alt+Xthenrecover-session
Undo last changeRepeat it to step further back through earlier changes in the buffer.
Ctrl+XthenUorCtrl+_orCtrl+/
Revert buffer to fileRereads the visited file from disk and discards unsaved edits, after asking for confirmation.
Alt+Xthenrevert-buffer
Redraw the displayThe same key that recenters the line; it also repaints the display when stray output has corrupted it.
Ctrl+L
Incremental search 9
Action
Shortcut
Search forwardFinds matches as you type; press it again to jump to the next match.
Ctrl+S
Search backwardLooks toward the start of the buffer as you type; press again for the previous match.
Ctrl+R
Regexp search forwardReads the typed text as a regular expression instead of literal characters.
Ctrl+Alt+S
Regexp search backwardIncremental regular-expression search toward the beginning of the buffer.
Ctrl+Alt+R
Previous search stringDuring a search, recalls an earlier entry from the search ring.
Alt+P
Next search stringDuring a search, moves forward again through the search ring.
Alt+N
End the searchLeaves the cursor at the match that was found.
Enter
Undo last search characterRemoves the most recently typed character and returns to the earlier match.
Backspace
Abort the searchReturns to where the search began; while a search is failing, it first removes only the unmatched characters.
Ctrl+G
Motion 28
Action
Shortcut
Back one characterThe Left arrow key behaves the same, except in right-to-left paragraphs.
Ctrl+B
Forward one characterThe Right arrow key behaves the same, except in right-to-left paragraphs.
Ctrl+F
Back one wordMoves to the start of the word before the cursor.
Alt+B
Forward one wordMoves to the end of the current or next word.
Alt+F
Previous lineMoves up one screen line, keeping the column where possible, as the Up arrow does.
Ctrl+P
Next lineMoves down one screen line, keeping the column where possible, as the Down arrow does.
Ctrl+N
Go to line startThe Home key runs the same command.
Ctrl+A
Go to line endThe End key runs the same command.
Ctrl+E
Back one sentenceMoves to the start of the current sentence, or of the one before if already there.
Alt+A
Forward one sentenceMoves to the end of the current sentence.
Alt+E
Back one paragraphMoves to the beginning of the current or preceding paragraph.
Alt+{
Forward one paragraphMoves to the end of the current or following paragraph.
Alt+}
Back one pageMoves to the preceding page boundary, which is a formfeed character in the text.
Ctrl+Xthen[
Forward one pageMoves to the next formfeed character, the page separator.
Ctrl+Xthen]
Back over an expressionMoves backward across one balanced expression, such as a parenthesized group, string or symbol.
Ctrl+Alt+B
Forward over an expressionMoves forward across one balanced expression; what counts depends on the major mode's syntax.
Ctrl+Alt+F
Go to function startMoves to the beginning of the current or preceding function definition.
Ctrl+Alt+A
Go to function endMoves to the end of the current or following function definition.
Ctrl+Alt+E
Go to buffer startSets the mark at the old position first, so you can jump back.
Alt+<
Go to buffer endLeaves the mark at the old position before moving to the last character.
Alt+>
Scroll forward one screenShows the next windowful of text, keeping a couple of lines for continuity.
Ctrl+V
Scroll back one screenShows the windowful of text before the one displayed.
Alt+V
Scroll text leftMoves the text in the window leftward, revealing columns further to the right.
Ctrl+Xthen<
Scroll text rightMoves the text in the window rightward, back toward the first column.
Ctrl+Xthen>
Recenter the current lineScrolls the window so the line is centered; pressing again moves it to the top, then the bottom.
Ctrl+L
Go to line numberPrompts for a line number and moves to the start of that line.
Alt+GthenG
Go to character positionPrompts for a number and moves to that position, counted from the buffer's start.
Alt+GthenC
Go to first non-blank characterMoves to the first character on the line that is not a space or tab.
Alt+M
Killing and deleting 15
Backspace stands for the key the card calls DEL, which is not the Delete key. Likewise the card's RET is written Enter here and SPC is written Space.
Action
Shortcut
Delete previous characterDeleted text is not saved in the kill ring, so it cannot be yanked back.
Backspace
Delete next characterRemoves the character under the cursor without saving it to the kill ring.
Ctrl+D
Kill word backwardKills from the cursor back to the start of the word.
Alt+Backspace
Kill word forwardKills from the cursor to the end of the word.
Alt+D
Kill to line startThe zero argument makes the line-kill command remove the text before the cursor instead.
Alt+0thenCtrl+K
Kill to line endOn an empty line or at a line's end it removes the line break instead.
Ctrl+K
Kill sentence backwardKills back to the beginning of the sentence.
Ctrl+XthenBackspace
Kill sentence forwardKills from the cursor through the end of the sentence.
Alt+K
Kill expression backwardA negative argument reverses the expression-kill command, so it removes the balanced expression before the cursor.
Alt+-thenCtrl+Alt+K
Kill expression forwardKills the balanced expression that follows the cursor.
Ctrl+Alt+K
Kill regionCuts the text between the mark and the cursor and saves it in the kill ring.
Ctrl+W
Copy regionSaves the region in the kill ring without removing it from the buffer.
Alt+W
Zap to characterType a character next: everything up to and including where it appears again is killed.
Alt+Z
Yank last killPastes the most recently killed or copied text at the cursor.
Ctrl+Y
Yank earlier killRight after a yank, swaps the pasted text for the entry before it in the kill ring.
Alt+Y
Marking 8
Action
Shortcut
Set the markStarts a region at the cursor; moving the cursor then extends the selection.
Ctrl+@orCtrl+Space
Swap point and markJumps to the other end of the region and reactivates it.
Ctrl+XthenCtrl+X
Mark next wordPuts the mark at the end of the next word without moving the cursor; an argument sets the word count.
Alt+@
Mark paragraphSelects the paragraph around or after the cursor, with the cursor at its beginning.
Alt+H
Mark pageSelects the current page, the text between two formfeed characters.
Ctrl+XthenCtrl+P
Mark expressionSets the mark after the next balanced expression and leaves the cursor in place.
Ctrl+Alt+@
Mark functionSelects the whole function definition around the cursor.
Ctrl+Alt+H
Select entire bufferPuts the cursor at the beginning and the mark at the end of the buffer.
Ctrl+XthenH
Query replace 10
Action
Shortcut
Query replacePrompts for the text to find and its replacement, then asks at each match.
Alt+%
Query replace with regexpAsks the same questions, but the search text is a regular expression.
Alt+Xthenquery-replace-regexp
Replace and continueAnswer at a match: accepts the replacement and moves to the next match.
SpaceorY
Replace and stayMakes the replacement but stays on it so the result can be checked.
,
Skip this matchLeaves the match unchanged and moves to the next one.
BackspaceorN
Replace all remainingChanges every later match without asking again.
!
Go back one matchReturns to the match before this one, in case it was answered wrongly.
^
Stop replacingEnds the command and leaves the remaining matches as they are.
Enter
Enter a recursive editPauses the questions so you can edit the text around the match by hand.
Ctrl+R
Exit the recursive editReturns to the interrupted command, such as the next replacement question.
Ctrl+Alt+C
Multiple windows 25
Action
Shortcut
Delete other windowsMakes the selected window fill the whole frame.
Ctrl+Xthen1
Delete other framesCloses every frame on the terminal except the selected one.
Ctrl+Xthen5then1
Split window belowDivides the selected window into two, one above the other, both showing the same buffer.
Ctrl+Xthen2
Create a new frameOpens another frame, the frame-level counterpart of splitting a window.
Ctrl+Xthen5then2
Delete this windowCloses the selected window; its buffer stays open and its space goes to neighbouring windows.
Ctrl+Xthen0
Delete this frameCloses the selected frame, which fails with an error when it is the only one.
Ctrl+Xthen5then0
Split window rightDivides the selected window into two placed left and right.
Ctrl+Xthen3
Scroll the other windowScrolls the next window forward without selecting it.
Ctrl+Alt+V
Switch to another windowMoves the cursor to the next window in cyclic order.
Ctrl+XthenO
Switch to another frameSelects the next frame and raises it.
Ctrl+Xthen5thenO
Switch buffer in other windowPrompts for a buffer and shows it in another window, which becomes selected.
Ctrl+Xthen4thenB
Switch buffer in other framePrompts for a buffer and selects it in a different frame.
Ctrl+Xthen5thenB
Show buffer in other windowDisplays the chosen buffer in another window but keeps the current window selected.
Ctrl+Xthen4thenCtrl+O
Show buffer in other frameDisplays the chosen buffer in another frame without switching to it.
Ctrl+Xthen5thenCtrl+O
Open file in other windowPrompts for a file name and visits it in another window.
Ctrl+Xthen4thenF
Open file in other framePrompts for a file name and visits it in a different frame.
Ctrl+Xthen5thenF
Open file read-only, other windowVisits the named file in another window with editing switched off.
Ctrl+Xthen4thenR
Open file read-only, other frameVisits the named file in a different frame with editing switched off.
Ctrl+Xthen5thenR
Open Dired in other windowPrompts for a directory and lists it with the Dired file manager in another window.
Ctrl+Xthen4thenD
Open Dired in other framePrompts for a directory and lists it with Dired in a different frame.
Ctrl+Xthen5thenD
Find definition in other windowLooks up the identifier at the cursor and shows where it is defined in another window.
Ctrl+Xthen4then.
Find definition in other frameLooks up the identifier at the cursor and shows its definition in a different frame.
Ctrl+Xthen5then.
Make window tallerAdds one line to the selected window's height; a numeric argument gives the line count.
Ctrl+Xthen^
Make window narrowerTakes one column from the selected window's width.
Ctrl+Xthen{
Make window widerAdds one column to the selected window's width.
Ctrl+Xthen}
Formatting 14
Action
Shortcut
Indent current lineIndents according to the major mode, for example to the right depth in program code.
Tab
Indent regionRe-indents every line of the region as Tab would.
Ctrl+Alt+\
Indent expressionRe-indents all lines inside the balanced expression that starts at the cursor.
Ctrl+Alt+Q
Indent region rigidlyShifts the region's lines sideways as a block; without an argument, Left and Right then adjust it.
Ctrl+XthenTab
Insert or align commentAdds a comment at the comment column or realigns an existing one; with an active region it comments or uncomments the region.
Alt+;
Open a new lineInserts a line break after the cursor, which stays where it is.
Ctrl+O
Split line verticallyMoves the text after the cursor to a new line, indented to the same column.
Ctrl+Alt+O
Delete blank linesReduces a run of blank lines to one; on a single blank line it removes that line.
Ctrl+XthenCtrl+O
Join with previous lineMerges the line into the one above, leaving one space; with an argument it joins the following line.
Alt+^
Delete horizontal spaceRemoves all spaces and tabs on both sides of the cursor.
Alt+\
Collapse spaces to oneLeaves a single space at the cursor; repeated presses delete all spacing, then restore the original.
Alt+Space
Fill paragraphRewraps the paragraph's lines to fit within the fill column.
Alt+Q
Set fill columnUses the numeric argument as the new line width for filling.
Ctrl+XthenF
Set fill prefixTakes the text from the line's start up to the cursor as the prefix for filled lines.
Ctrl+Xthen.
Changing case and transposing 9
Action
Shortcut
Uppercase wordConverts from the cursor to the end of the word and moves past it.
Alt+U
Lowercase wordConverts the rest of the word to lower case and moves past it.
Alt+L
Capitalize wordMakes the first letter of the following word upper case and the rest lower case.
Alt+C
Uppercase regionDisabled by default: the first use asks for confirmation and offers to enable it.
Ctrl+XthenCtrl+U
Lowercase regionConverts the text between cursor and mark; like its uppercase twin it asks before first use.
Ctrl+XthenCtrl+L
Transpose charactersSwaps the character before the cursor with the one under it; at a line's end, the last two.
Ctrl+T
Transpose wordsSwaps the word before the cursor with the word after it, leaving punctuation between them in place.
Alt+T
Transpose linesSwaps the current line with the one above it.
Ctrl+XthenCtrl+T
Transpose expressionsSwaps the balanced expressions before and after the cursor.
Ctrl+Alt+T
The minibuffer 11
Action
Shortcut
Complete inputFills in as much of the name as the matching candidates share.
Tab
Complete one wordCompletes only up to the next hyphen or space; not available when reading file names.
Space
Submit the inputSends the minibuffer text to the command, completing it first where a full match is required.
Enter
List completionsOpens a window showing every candidate that matches the text typed so far.
?
Previous history entryBrings back an earlier input of the same kind into the minibuffer.
Alt+P
Next history entryMoves to a later input; past the newest entry it offers the command's default values.
Alt+N
Search history backwardPrompts for a regexp and recalls the nearest earlier entry that matches it.
Alt+R
Search history forwardPrompts for a regexp and recalls the next later entry that matches it.
Alt+S
Cancel the minibufferLeaves the prompt and abandons the command that was asking for input.
Ctrl+G
Repeat last minibuffer commandShows the earlier command as Lisp text to edit, then runs it again on Enter.
Ctrl+XthenEscthenEsc
Open the menu barGives keyboard access to the menus; the card points it out for text terminals.
F10
Spelling check 4
Action
Shortcut
Check word spellingOffers corrections when the word at the cursor is misspelled; with an active region it checks every word there.
Alt+$
Check region spellingSteps through each misspelled word between cursor and mark.
Alt+Xthenispell-region
Check buffer spellingRuns the checker from the start of the buffer to its end.
Alt+Xthenispell-buffer
Toggle Flyspell modeHighlights misspelled words while you type, without interrupting the typing.
Alt+Xthenflyspell-mode
Tags 4
Action
Shortcut
Find a definitionJumps to the place where the identifier at the cursor is defined.
Alt+.
Select a tags tablePrompts for the TAGS file that later tag commands should use.
Alt+Xthenvisit-tags-table
Search tagged filesLooks for a regexp through every file named in the tags table, stopping at the first match.
Alt+Xthentags-search
Query replace in tagged filesRuns a regexp query-replace across every file in the tags table.
Alt+Xthentags-query-replace
Shells 5
Action
Shortcut
Run a shell commandReads one command line in the minibuffer and shows its output in the echo area or a buffer.
Alt+!
Run shell command in backgroundStarts the command without waiting for it; output collects in a separate buffer.
Alt+&
Pipe region to shell commandSends the region's text to the command as its input and displays the output.
Alt+|
Filter region through commandWith the prefix argument, the command's output replaces the region in the buffer.
Ctrl+UthenAlt+|
Open an interactive shellStarts a subshell whose input and output go through a buffer named *shell*.
Alt+Xthenshell
Rectangles and registers 10
Action
Shortcut
Copy rectangle to registerPrompts for a register name and stores the rectangle between mark and cursor in it.
Ctrl+XthenRthenR
Kill rectangleRemoves the rectangle whose corners are the mark and the cursor, saving it for a later rectangle yank.
Ctrl+XthenRthenK
Yank rectangleInserts the last killed rectangle with its upper left corner at the cursor.
Ctrl+XthenRthenY
Open rectangleFills the marked rectangle with blanks and pushes its former contents to the right.
Ctrl+XthenRthenO
Clear rectangleOverwrites everything inside the rectangle with spaces.
Ctrl+XthenRthenC
Replace rectangle with stringReplaces the rectangle's contents on every line with the text typed at the prompt.
Ctrl+XthenRthenT
Copy region to registerPrompts for a register name, a single character, and stores the region's text there.
Ctrl+XthenRthenS
Insert registerPrompts for a register and inserts the text it holds at the cursor.
Ctrl+XthenRthenI
Save position to registerRecords the cursor's place, and its buffer, under a register name.
Ctrl+XthenRthenSpace
Jump to registerReturns to a position stored earlier, switching buffers if necessary.
Ctrl+XthenRthenJ
Abbrevs 6
Action
Shortcut
Add global abbrevUses the word before the cursor as the expansion and prompts for the abbreviation, valid in all modes.
Ctrl+XthenAthenG
Add mode abbrevDefines an abbreviation for the word before the cursor that applies only in the current major mode.
Ctrl+XthenAthenL
Define word as global abbrevTreats the word before the cursor as the abbreviation and prompts for its expansion.
Ctrl+XthenAthenIthenG
Define word as mode abbrevPrompts for the expansion of the word before the cursor, for the current major mode only.
Ctrl+XthenAthenIthenL
Expand abbrevExpands the abbreviation before the cursor, even when Abbrev mode is off.
Ctrl+XthenAthenE
Dynamic abbrev expansionCompletes the word before the cursor from words elsewhere in the buffer; repeat for other candidates.
Alt+/
Commands and arguments 4
Action
Shortcut
Execute a named commandType the command's name in the minibuffer, with completion available, and finish with Enter.
Alt+X
Numeric argumentType digits after it to give the next command a count; alone it means four.
Ctrl+U
Negative argumentGives the next command an argument of minus one, usually reversing its direction.
Alt+-
Quoted insertInserts the next character typed literally, so control characters can be put in the text.
Ctrl+Q
Keyboard macros 6
Action
Shortcut
Start recording a macroFrom here on, the keys you type are both executed and stored as the macro.
Ctrl+Xthen(
Stop recording the macroEnds the definition without running the macro.
Ctrl+Xthen)
Run the last macroReplays the most recent macro; if one is still being recorded, it ends the recording first.
Ctrl+XthenE
Append to the last macroWith the prefix argument, recording adds further keys onto the end of the previous macro.
Ctrl+UthenCtrl+Xthen(
Name the last macroTurns the macro into a command with the name you type, valid for the current session.
Alt+Xthenname-last-kbd-macro
Insert macro as LispWrites Lisp code defining a named macro into the buffer, for saving in an init file.
Alt+Xtheninsert-kbd-macro
Emacs Lisp and customization 6
Action
Shortcut
Evaluate previous expressionEvaluates the Lisp expression that ends just before the cursor and shows its value in the echo area.
Ctrl+XthenCtrl+E
Evaluate current defunEvaluates the top-level form that contains the cursor or follows it, such as a function definition.
Ctrl+Alt+X
Evaluate regionEvaluates every Lisp expression between the cursor and the mark.
Alt+Xtheneval-region
Evaluate an expressionReads a single Lisp expression in the minibuffer and prints its value in the echo area.
Alt+:
Load a Lisp libraryPrompts for a library name and looks for it in the directories of load-path.
Alt+Xthenload-library
Open the customization bufferShows groups of user options and faces whose values can be edited and saved.
Alt+Xthencustomize
International character sets 6
Action
Shortcut
Set language environmentPrompts for a language name and adjusts default coding systems and input method for it.
Ctrl+XthenEnterthenL
List input methodsDisplays every supported input method with a short description.
Alt+Xthenlist-input-methods
Toggle input methodTurns the selected input method on or off; the first use prompts for one.
Ctrl+\
One-off coding systemPrompts for a coding system that applies only to the command typed immediately after.
Ctrl+XthenEnterthenC
List coding systemsDisplays every supported coding system with a short description.
Alt+Xthenlist-coding-systems
Prefer a coding systemMoves the named coding system to the front of the priority list used when reading files.
Alt+Xthenprefer-coding-system
Info reader 19
Action
Shortcut
Open the Info readerShows the directory of installed manuals in Info mode.
Ctrl+HthenI
Look up symbol in InfoFinds the manual entry for a symbol, choosing the manual by the current major mode.
Ctrl+HthenShift+S
Scroll forwardPages down inside the node and continues into the next node at its end.
Space
Scroll backwardPages up inside the node and steps to the preceding node at its top.
Backspace
Go to node startJumps back to the top of the node being read.
B
Next nodeGoes to the following node on the same level of the manual.
N
Previous nodeGoes to the preceding node on the same level.
P
Up one levelGoes to the parent node, usually the menu that lists this one.
U
Pick a menu item by namePrompts with completion for a subtopic listed in the node's menu.
M
Pick menu item 1 to 9A digit key opens the menu entry with that position in the node's menu.
1
Follow a cross referencePrompts for the name of a reference in the node and jumps to it.
F
Go back in historyReturns to the node visited just before this one.
L
Go to the directory nodeShows the top-level list of all installed manuals.
D
Go to the manual's top nodeJumps to the first node of the manual being read.
T
Go to a node by namePrompts for a node name, which may include a manual's file name in parentheses.
G
Start the Info tutorialOpens the introductory lesson on using the Info reader.
H
Search the indexPrompts for a topic and jumps to the node its index entry points to.
I
Search the manualLooks for the typed text through the whole manual, starting from the current node.
S
Quit InfoHides the Info buffer and brings back the buffer you were working in.
Q
Regular expression syntax 28
Action
Shortcut
Any single characterTyped in a regexp prompt, matches one character of any kind other than a line break.
.
Repeat zero or more timesPostfix operator: matches the preceding expression as many times as possible, including none.
*
Repeat one or more timesLike the star operator, but the preceding expression must match at least once.
+
Optional matchThe preceding expression may match once or be absent.
?
Quote a special characterPlaced before a special character such as the dot or star, makes it match itself.
\
Either alternativeMatches either the expression on its left or the one on its right.
\|
Capturing groupGroups a sub-expression for repetition or alternation and records what it matched.
\( ... \)
Shy groupGroups without recording the match, so it does not count toward numbered groups.
\(?: ... \)
Explicitly numbered groupRecords the match under the group number written in place of NUM.
\(?NUM: ... \)
Back reference to a groupWith a digit in place of N, matches the same text that group matched.
\N
Word boundaryMatches the empty string at the beginning or end of a word.
\b
Not a word boundaryMatches the empty string anywhere except at the edge of a word.
\B
Start of lineMatches the empty string at the beginning of a line.
^
End of lineMatches the empty string at the end of a line.
$
Start of wordMatches the empty string where a word begins.
\<
End of wordMatches the empty string where a word ends.
\>
Start of symbolMatches the empty string where a symbol begins, as the major mode defines symbols.
\_<
End of symbolMatches the empty string where a symbol ends.
\_>
Start of bufferMatches the empty string at the very beginning of the buffer or string.
\`
End of bufferMatches the empty string at the very end of the buffer or string.
\'
Character setMatches any one of the characters listed between the brackets.
[ ... ]
Complemented character setMatches any one character that is not listed between the brackets.
[^ ... ]
Word characterMatches any character that the syntax table classes as part of a word.
\w
Non-word characterMatches any character that is not a word constituent.
\W
Character of a syntax classC is a one-character code for the class, such as w for word constituents or - for whitespace.
\sC
Character outside a syntax classMatches any character whose syntax class is not the one C names.
\SC
Character of a categoryC is a one-character category code; g, for example, stands for Greek characters.
\cC
Character outside a categoryMatches any character that does not belong to the category C names.
\CC
No row on this page matches that filter.
Notes
Reading the notation
The card writes C-x C-s where this page writes Ctrl + X, Ctrl + S: hold Ctrl and press X, let go, then hold Ctrl and press S. Many bindings are sequences of this kind, and some run to three or four keys, such as Ctrl + X, R, K. M- is the Meta key: Alt on most keyboards, Option on a Mac, or Esc pressed and released before the key. Ctrl + G cancels whatever is in progress, whether a half-typed sequence, a prompt in the minibuffer or a running command, and is the key to press whenever Emacs seems stuck.
Files and quitting
Ctrl + X, Ctrl + F opens a file with completion in the minibuffer, Ctrl + X, Ctrl + S saves the current buffer and Ctrl + X, Ctrl + C quits, offering to save modified buffers first. Buffers, not files, are what you edit: Ctrl + X, B switches between them and Ctrl + X, Ctrl + B lists them.
Editing and commands
Ctrl + W kills (cuts) the region between mark and cursor, Alt + W copies it and Ctrl + Y yanks (pastes); the kill ring keeps earlier entries, and Alt + Y right after a yank steps back through them. Undo is Ctrl + /, repeated to go further back. Ctrl + S starts an incremental search that moves as you type, and pressing it again finds the next match. Alt + X runs any command by name with completion, and Ctrl + H, K followed by a key shows what that key does.
Questions
How do I save a file and quit Emacs?
Press Ctrl + X, Ctrl + S to save the current buffer, then Ctrl + X, Ctrl + C to quit. If other file buffers still have unsaved changes, Emacs offers to save each of them before it exits.
What does M-x mean, and what if my keyboard has no Meta key?
M- is the Meta modifier, so M-x is Alt + X on most keyboards and Option with X on a Mac. Where Alt does not reach Emacs, as in some terminals, press Esc, release it, then press X.
How do I cancel a command or leave a prompt in Emacs?
Press Ctrl + G. It aborts a partially typed key sequence, a command that is running, an incremental search or a prompt in the minibuffer.
What do kill and yank mean in Emacs?
Killing removes text and saves it in the kill ring: Ctrl + W kills the region and Ctrl + K the rest of the line. Yanking with Ctrl + Y inserts the latest kill again, and Alt + Y swaps it for an earlier one. Deleting, as with Ctrl + D, does not save the text.
Are the Emacs keys the same on Windows, macOS and Linux?
The reference card prints one list for every system. What differs is the key that acts as Meta: Alt on most keyboards, and on macOS both Option and Alt by default, while Cmd is a separate modifier that Emacs calls Super.