Run a command by name
Type M-x, then the command name, then Enter. Emacs runs any command by name.
Editing, file, window, buffer and help keys for GNU Emacs. Every item below is clearly marked as a shortcut, command, or syntax reference.
Type M-x, then the command name, then Enter. Emacs runs any command by name.
Stop a command that is running, or abandon a command you have started typing.
Read a file into a buffer and start editing it (find-file).
Write the buffer's text back to the file it came from (save-buffer).
Move to the beginning of the current line (move-beginning-of-line).
Move to the end of the current line (move-end-of-line).
Cut from the cursor to the end of the line, or whole lines when the cursor is already at the line's end (kill-line).
Cut backwards to the start of the word (backward-kill-word).
Type M-x, then the command name, then Enter. Emacs runs any command by name.
Stop a command that is running, or abandon a command you have started typing.
Read a file into a buffer and start editing it (find-file).
Write the buffer's text back to the file it came from (save-buffer).
Move to the beginning of the current line (move-beginning-of-line).
Move to the end of the current line (move-end-of-line).
Cut from the cursor to the end of the line, or whole lines when the cursor is already at the line's end (kill-line).
Cut backwards to the start of the word (backward-kill-word).
Reinsert the most recently killed text at the cursor (yank).
Step backwards through the undo records, one command at a time (undo). C-/ , C-x u and C-_ all do it.
Start an incremental search towards the end of the buffer; it moves as you type (isearch-forward).
Select an existing buffer, or create a new one, by name (switch-to-buffer).
Save buffers if needed and exit Emacs.
Pause Emacs and return to the shell it was started from (graphical frames minimize instead).
Save the current buffer under a new file name you type (write-file).
Go through the buffers that have unsaved changes and save the ones you agree to (save-some-buffers).
Move the cursor right by one character (forward-char).
Move the cursor left by one character (backward-char).
Move the cursor down one screen line (next-line).
Move the cursor up one screen line (previous-line).
Jump forward over the next word (forward-word).
Jump back over the previous word (backward-word).
Move point to the very beginning of the buffer (beginning-of-buffer).
Move point to the very end of the buffer (end-of-buffer).
Remove the character in front of the cursor (delete-char).
Cut an entire line, including its newline, wherever the cursor sits on it (kill-whole-line).
Cut from the cursor to the end of the word (kill-word).
Cut the marked region and put it in the kill ring (kill-region).
Put the region in the kill ring without deleting it (kill-ring-save).
Replace the text just yanked with an earlier kill from the kill ring (yank-pop).
Swap the word before the cursor with the one after it (transpose-words).
Remove all spaces and tabs on either side of the cursor (delete-horizontal-space).
Clear the blank lines above and below the current line down to a single blank line (delete-blank-lines).
Delete the newline between the current line and the previous one, keeping indentation sensible (delete-indentation).
Place the mark at the cursor so the region runs from there to the cursor (set-mark). Also written C-@.
Put the mark at the cursor and move the cursor to where the mark was (exchange-point-and-mark).
Select every character in the buffer (mark-whole-buffer).
Select the paragraph around the cursor (mark-paragraph).
Incremental search towards the start of the buffer (isearch-backward).
Split the selected window into two windows, one above the other (split-window-below).
Split the selected window into two windows next to each other (split-window-right).
Move the cursor into the next window on the frame (other-window).
Keep only the selected window, closing the rest of the frame (delete-other-windows).
Scroll the window that is not selected, without moving into it (scroll-other-window).
Move down a full screen of text (scroll-up-command).
Move up a full screen of text (scroll-down-command).
Scroll so the line under the cursor sits in the middle of the window (recenter).
Show a list of the current buffers in another window (list-buffers).
Kill a buffer by name, asking first if it has unsaved changes (kill-buffer).
Show the command a key sequence is bound to, with its documentation (describe-key).
Look up a function or command by name and read its doc string (describe-function).
Look up a variable by name and read its value and doc string (describe-variable).
Display every active key binding in a help buffer (describe-bindings).
Report the character under the cursor, its position in the buffer, and the line and column (what-cursor-position).
Entries with recorded Mac keys are listed below. Official source links are on each reference page.
Examples in this reference include Run a command by name (Alt + X), Cancel the current command (Ctrl + G), Open a file (Ctrl + X, Ctrl + F), Save the current file (Ctrl + X, Ctrl + S), Go to the start of the line (Ctrl + A).
Mac key values are listed for 54 of the 54 entries. Use the value shown for the specific action; do not assume Ctrl can be replaced with Cmd. Each reference page links its official source.
Some reference pages include a menu alternative. When no equivalent is documented here, consult the linked official help rather than assuming a key combination.