Complete Emacs Keyboard Shortcuts Cheat Sheet (150+ Key Bindings)

Emacs keyboard shortcuts use two modifier keys: C- (hold Control) and M- (hold Alt, or press then release Escape). The most essential shortcuts are C-x C-f to open a file, C-x C-s to save, C-g to cancel any command, and M-x to run any Emacs command by name.

GNU Emacs is one of the oldest and most powerful text editors in existence first released in 1976 by Richard Stallman as part of the GNU Project, it has over 3,000 built-in commands accessible entirely from the keyboard. Unlike most modern editors, Emacs is designed to be operated without ever touching the mouse, which is why mastering its shortcuts is the single biggest productivity unlock for developers, writers, and system administrators who use it daily.

This cheat sheet covers 150+ Emacs keyboard shortcuts organized into 12 categories from basic file operations and navigation to buffer management, macros, and the help system. Whether you are a complete beginner who just installed Emacs for the first time, or an experienced user who wants a reliable reference to bookmark, this page has everything you need.

Before you start: Here is how to read Emacs shortcut notation:

NotationMeaningExample
C-xHold Ctrl, press xC-x C-s = save file
M-xHold Alt, press x (or press Esc, release, then press x)M-x = run command by name
C-x C-fHold Ctrl, press x, then still holding Ctrl, press fOpens a file
SPCSpacebarUsed in Spacemacs / Doom Emacs
RETEnter / Return keyConfirms a command
DELBackspace key

Quick tip: If you ever get stuck or accidentally trigger a command you don’t recognize, press C-g this is the universal cancel key in Emacs and will safely abort whatever is running.

Most Used Emacs Shortcuts (Essential Commands)

These are the shortcuts every Emacs user must know on day one. Learn these first before anything else.

ActionShortcutNotes
Open a fileC-x C-f“Find file” creates new file if it doesn’t exist
Save current bufferC-x C-sSaves in place
Save as (write to new file)C-x C-wPrompts for new filename
Save all open buffersC-x sPrompts for each unsaved buffer
Revert buffer to saved fileM-x revert-bufferDiscards unsaved changes
Quit EmacsC-x C-cPrompts to save unsaved buffers
Suspend Emacs (terminal)C-zSends to background; resume with fg
Cancel current commandC-gUniversal abort use this when stuck
UndoC-x u or C-/Emacs has unlimited undo
Redo (undo the undo)C-g then C-/Press C-g first to break the undo chain
Run command by nameM-xMost powerful shortcut in Emacs
Repeat last commandC-x zPress z again to keep repeating
Execute keyboard macroC-x eRuns the last recorded macro

Navigation Shortcuts

Navigation is the most-used category of shortcuts in daily Emacs use.

ActionShortcutNotes
Move forward one characterC-f
Move backward one characterC-b
Move forward one wordM-f
Move backward one wordM-b
Move to next lineC-n
Move to previous lineC-p
Move to beginning of lineC-a
Move to end of lineC-e
Move to beginning of sentenceM-a
Move to end of sentenceM-e
Move to beginning of paragraphM-{
Move to end of paragraphM-}
Move to beginning of bufferM-<
Move to end of bufferM->
Scroll down one screenC-v
Scroll up one screenM-v
Center screen on cursorC-lPress again to cycle top/bottom/center
Go to line numberM-g M-gPrompts for line number
Go to character positionM-g c
Jump to matching bracketC-M-f / C-M-bForward / backward

File Handling Shortcuts

ActionShortcutNotes
Open / find a fileC-x C-f
Save fileC-x C-s
Save file asC-x C-w
Insert file into bufferC-x iInserts at cursor position
Open file in read-only modeC-x C-r
Toggle read-only modeC-x C-q
Open recent filesM-x recentf-open-filesEnable recentf-mode first
Open file manager (Dired)C-x dBuilt-in directory editor
Open file in other windowC-x 4 C-fSplits screen and opens there
Open file in new frameC-x 5 C-fNew OS window

Killing (Cutting) and Yanking (Pasting)

Emacs uses its own terminology: kill = cut, yank = paste, kill ring = clipboard history.

ActionShortcutNotes
Cut (kill) selected regionC-w
Copy selected regionM-wSaves to kill ring without deleting
Paste (yank)C-yPastes most recent kill
Cycle through clipboard historyM-yPress after C-y to cycle older kills
Kill (cut) to end of lineC-kPress twice to kill the newline too
Kill entire lineC-S-backspace
Kill word forwardM-d
Kill word backwardM-DEL
Delete character forwardC-dDoes not go to kill ring
Delete character backwardDELBackspace
Kill to end of sentenceM-k
Kill region between cursor and markC-wSet mark first with C-SPC

Search and Replace Shortcuts

ActionShortcutNotes
Incremental search forwardC-sType to search as you go; C-s again = next match
Incremental search backwardC-r
Search forward with regexC-M-sRegular expression search
Search backward with regexC-M-r
Exit search at current positionRET
Cancel search, return to startC-g
Query replaceM-%Prompts y/n for each match
Query replace with regexC-M-%
Replace all without promptingM-x replace-string
Find next occurrenceC-sWhile already in search mode
Occur (list all matches)M-x occurShows all matches in a new buffer

Marking and Selecting (Region)

ActionShortcutNotes
Set mark (start selection)C-SPCSets the mark at cursor position
Select all (mark whole buffer)C-x h
Mark current wordM-@
Mark current paragraphM-h
Mark current function / defunC-M-h
Exchange cursor and markC-x C-xJumps to where selection started
Activate / show markC-SPC C-SPC
Select rectangle regionC-x SPCFor rectangle operations

Buffer Management Shortcuts

ActionShortcutNotes
Switch to another bufferC-x bType buffer name; Tab to autocomplete
List all open buffersC-x C-bOpens buffer list in a window
Kill (close) current bufferC-x kPrompts for confirmation if unsaved
Kill buffer without promptM-x kill-this-buffer
Switch to previous bufferC-x LEFTCycles backward
Switch to next bufferC-x RIGHTCycles forward
Rename current bufferM-x rename-buffer
Open buffer in other windowC-x 4 b
Save all unsaved buffersC-x s
Revert buffer from diskM-x revert-bufferReloads file from disk

Window and Frame Shortcuts

ActionShortcutNotes
Split window horizontally (top/bottom)C-x 2
Split window vertically (left/right)C-x 3
Close current windowC-x 0Buffer stays open
Close all other windowsC-x 1Maximizes current window
Switch to other windowC-x oCycles through open windows
Scroll other window downC-M-v
Grow window tallerC-x ^
Shrink window narrowerC-x {
Grow window widerC-x }
Open new OS frame (window)C-x 5 2
Close current frameC-x 5 0
Switch to other frameC-x 5 o

Formatting and Indentation Shortcuts

ActionShortcutNotes
Indent current lineTABContext-aware in most modes
Indent regionC-M-\
Fill / re-wrap paragraphM-qWraps to fill-column width
Set fill column widthC-x fDefault is 70 characters
Join line with previous lineM-^Removes leading whitespace
Delete all whitespace at pointM-\
Insert one space at pointM-SPC
Uppercase wordM-u
Lowercase wordM-l
Capitalize wordM-c
Uppercase regionC-x C-u
Lowercase regionC-x C-l
Comment / uncomment regionM-;
Insert newline and indentC-j
Transpose two charactersC-tSwaps character before and after cursor
Transpose two wordsM-t
Transpose two linesC-x C-t

Macro Shortcuts

ActionShortcutNotes
Start recording macroC-x (Everything you type is recorded
Stop recording macroC-x )
Run last macroC-x ePress e again to repeat
Run macro N timesC-u N C-x ee.g. C-u 10 C-x e runs 10 times
Name last macroM-x name-last-kbd-macroLets you call it by name with M-x
Save macro to init fileM-x insert-kbd-macroInserts macro definition as Lisp

Help System Shortcuts

ActionShortcutNotes
Open Emacs tutorialC-h tBest starting point for beginners
Describe a key bindingC-h kThen press any key to see what it does
Describe a functionC-h fType function name to see its docs
Describe a variableC-h v
Show all key bindingsC-h bFull list of active bindings
Find commands matching stringC-h aApropos search
Show key binding for commandC-h wReverse lookup
Open Emacs manualC-h iFull Info documentation browser
Show mode-specific helpC-h mShows current major and minor modes
Toggle quick-help cheat sheetC-h C-qBuilt-in cheat sheet in Emacs 29+
Describe current modeC-h m
Show recent messagesC-h eView the * Messages * buffer

Dired (Built-in File Manager) Shortcuts

ActionShortcutNotes
Open DiredC-x dPrompts for directory
Open file at cursorRET
Open file in other windowo
Go up to parent directory^
Mark file for operationm
Unmark fileu
Unmark allU
Delete marked filesD
Copy marked filesCPrompts for destination
Rename / move fileR
Create new directory +
Compress / uncompress fileZ
Run shell command on file!
Refresh directory listingg
Toggle hidden filesC-x M-o

Related: Best GNU Emacs Alternatives & Competitors

Emacs Shortcuts vs Vim Shortcuts: Side-by-Side Comparison

Emacs and Vim are the two most popular keyboard-driven text editors among developers and system administrators. Both are highly efficient once mastered, but they use fundamentally different philosophies for keyboard shortcuts. Here is how their key bindings compare for the most common editing tasks.

TaskEmacs ShortcutVim ShortcutKey Difference
Open a fileC-x C-f:e filenameEmacs uses chord keys; Vim uses command-line mode
Save a fileC-x C-s:wVim requires entering command mode first
Save and quitC-x C-c (then confirm):wq or ZZVim combines both in one command
Quit without savingC-x C-c then n:q!
UndoC-/ or C-x uuVim’s undo is simpler; Emacs has unlimited linear undo
RedoC-g then C-/C-rVim has a dedicated redo key
Cut lineC-kddEmacs cuts to end of line; Vim cuts whole line
Copy lineM-w (after selecting)yyVim’s yy yanks whole line without selecting
PasteC-ypBoth editors call this “yank” internally
Search forwardC-s/Emacs searches incrementally as you type
Search backwardC-r?
Find and replaceM-%:%s/old/new/gVim’s regex replace is more concise
Move to line startC-a0 or ^
Move to line endC-e$
Move to file startM-<ggVim’s navigation is shorter
Move to file endM->G
Move forward one wordM-fw
Move backward one wordM-bb
Delete characterC-dx
Select a regionC-SPC then move cursorv then move cursorBoth use visual/mark mode concept
Run a commandM-x command-name:command-name
Split window horizontallyC-x 2:split
Split window verticallyC-x 3:vsplit
Switch windowC-x oC-w C-w
Comment lineM-;gc (with plugin)Vim needs a plugin; Emacs has it built in
Open file managerC-x d (Dired):Ex (netrw)Both have built-in file managers
Access helpC-h k:helpEmacs help is more interactive
Macro record startC-x (qq
Macro record stopC-x )q
Run macroC-x e@q

Which Is Harder to Learn – Emacs or Vim?

Both editors have steep learning curves, but in different ways.

Vim has a steeper initial learning curve because it uses modal editing you are always in one of several modes (Normal, Insert, Visual, Command), and the same key does different things depending on which mode you are in. New users frequently get stuck because pressing keys in Normal mode triggers commands rather than typing text. However, once the modal concept clicks, Vim’s shortcuts tend to be shorter and faster to type single keys like dd, yy, and gg replace Emacs chord sequences.

Emacs has a gentler initial curve because it always behaves like a conventional editor you can type text immediately without switching modes. However, its shortcuts are chord-heavy, requiring you to hold Control or Alt for almost every command. Long-term Emacs use is associated with a condition known as “Emacs pinky” repetitive strain from constantly reaching for the Ctrl key which many users address by remapping Caps Lock to Control.

FactorEmacsVim
Initial learning curveModerateSteep
Long-term mastery curveSteepModerate
Shortcut styleChord-based (C-x C-f)Modal + single keys (dd, yy)
Typing without learning shortcutsYes, works immediatelyNo, must learn modes first
ExtensibilityEmacs Lisp virtually unlimitedVimscript / Lua (Neovim)
Startup timeSlowerFaster
Built-in featuresExtremely rich (email, calendar, git)Focused on text editing
Best forDevelopers who want an OS-in-an-editorDevelopers who want fast, focused editing
Popular distributionsSpacemacs, Doom EmacsNeovim, LunarVim

If you primarily want a fast, modal text editor, Vim or Neovim is the better starting point. If you want a deeply extensible environment where you can manage files, run Git, write org documents, and edit code all in one place, Emacs is worth the investment. Many experienced developers learn both.

Frequently Asked Questions About Emacs Shortcuts

How do I exit Emacs?

Press C-x C-c to quit Emacs. If you have unsaved buffers, Emacs will prompt you to save each one before closing. If you want to quit immediately without saving anything, type C-x C-c then answer no to each prompt. This is one of the most searched Emacs questions because new users often get trapped inside the editor C-x C-c is always the way out.

What does C- mean in Emacs shortcuts?

C- means hold the Control (Ctrl) key while pressing the next key. For example, C-s means hold Ctrl and press S. C-x C-f means hold Ctrl, press X, then still holding Ctrl, press F. The C- prefix is used for the most common, frequently-used commands in Emacs.

What does M- mean in Emacs shortcuts?

M- stands for Meta key, which on modern keyboards is the Alt key. For example, M-x means hold Alt and press X. If your Alt key does not work (common on macOS), you can also press and release the Escape key first, then press the next key so M-x becomes Esc then X. Both methods produce the same result.

How do I undo in Emacs?

Press C-/ or C-x u to undo in Emacs. Unlike most editors, Emacs has a linear unlimited undo history every change is recorded and can be undone. To redo (undo the undo), press C-g to break the undo chain, then press C-/ again. Emacs does not have a separate redo command; instead, undos become part of the history that can themselves be undone.

How do I save a file in Emacs?

Press C-x C-s to save the current file (buffer) in Emacs. To save a file under a different name, use C-x C-w (Save As). To save all open unsaved buffers at once, use C-x s Emacs will prompt you for each unsaved buffer individually.

How do I open a file in Emacs?

Press C-x C-f to open a file in Emacs. This command is called “find-file” and works for both existing files and creating new ones if the file does not exist, Emacs will create it when you save. You can also open a file in a second window alongside your current file using C-x 4 C-f.

How do I search for text in Emacs?

Press C-s to start an incremental search forward in Emacs. As you type your search term, Emacs jumps to the first match in real time. Press C-s again to jump to the next match. Press C-r to search backward. Press RET to stay at the current match, or C-g to cancel and return to where you started. For regular expression search, use C-M-s.

What is M-x in Emacs?

M-x is the command executor in Emacs pressing it opens a prompt where you can type the name of any Emacs command and run it. It is the most powerful shortcut in Emacs because it gives you access to all 3,000+ built-in commands, not just the ones with key bindings. For example, M-x replace-string runs a find-and-replace, and M-x org-mode switches the current buffer to Org mode.

How do I copy and paste in Emacs?

Emacs uses its own terminology for copy and paste. To copy text, first select it by setting a mark with C-SPC and moving the cursor, then press M-w to copy (called “kill-ring-save”). To paste, press C-y (called “yank”). To cut instead of copy, use C-w after selecting. Emacs maintains a clipboard history called the kill ring press M-y after yanking to cycle through previously copied items.

How do I switch between open files in Emacs?

Press C-x b to switch buffers in Emacs. Type the name of the buffer (file) you want to switch to press Tab to autocomplete. To see a list of all open buffers, press C-x C-b. Use C-x LEFT and C-x RIGHT to cycle backward and forward through buffers without typing a name.

What is the difference between Emacs shortcuts on Linux, macOS, and Windows?

Most GNU Emacs shortcuts work identically on Linux, macOS, and Windows. The main difference is the Meta key: on Linux and Windows, M- maps to the Alt key. On macOS, Alt/Option may not work by default you may need to either use the Escape key as Meta, or configure your terminal emulator to send Alt as Meta. On Windows, some C- shortcuts (like C-z, C-c, C-x) conflict with standard Windows shortcuts, which can be resolved by enabling CUA Mode in Emacs.

Conclusion

GNU Emacs has been the editor of choice for developers, researchers, and system administrators for nearly five decades and the reason is simple: once you internalize its keyboard shortcuts, you can edit text, manage files, run code, track tasks, and navigate your entire workflow without ever leaving the keyboard.

The shortcuts in this guide cover everything you need to go from complete beginner to confident daily Emacs user. Start with the essentials C-x C-f to open, C-x C-s to save, C-g to cancel, and M-x to run any command and build from there. Most experienced Emacs users will tell you the same thing: learn ten shortcuts deeply rather than fifty shortcuts shallowly. Muscle memory matters more than memorization.

If you ever get stuck, remember that C-h is your best friend C-h k describes any key you press, C-h f explains any function by name, and C-h t opens the built-in Emacs tutorial that ships with every installation.

If you are evaluating Emacs alongside other editors, our Vim shortcuts cheat sheet covers the full Vim key binding reference with the same level of detail as this guide. For terminal productivity beyond your editor, our Linux Mint keyboard shortcuts guide covers system-level shortcuts that pair well with Emacs on any Linux setup.

READ NEXT:

Pratik

Pratik is the founder of Tutorial Tactic and a productivity tools specialist with 15 years of hands-on experience in Google Workspace, Microsoft Office, and software automation. He has published over 1,500 guides on keyboard shortcuts, software commands, how-to tutorials and workflow optimization, helping readers across the US and India work faster with the tools they use every day. Tutorial Tactic was founded in 2021 with one goal: cut through the noise and give readers exactly what they need fast, verified, and beginner-friendly.
Back to top button