Professional Documents
Culture Documents
Emacs Cheat Sheet
Emacs Cheat Sheet
Common Abbreviations: M-x means press and then release the Meta key and then press the x key C-x means press and hold the Control key and then press and release the x key
Unix PC Macintosh
Command Open a file Insert another file at the current cursor position Save current file Save current file with another name (similar to Save As) Open an additional file
Keystroke C-x C-f C-x i C-x C-s C-x C-w C-x C-f
Command-Line M-x find-file M-x insert-file M-x save-buffer M-x write-file M-x find file
Command Move to the previous buffer Display buffer list Delete current buffer
Command Move to the beginning of a buffer Move to the end of a buffer Move forward one character Move backward one character Move down one line Move up on line Move forward one word Move backward one word Move to the end of a line Move to the beginning of a line Move forward one screen Move backward one screen
Keystroke M-< M-> C-f C-b C-n C-p M-f M-b C-e C-a C-v M-v
Command-Line M-x beginning-of-buffer M-x end-of-buffer M-x forward-char M-x backward-char M-x next-line M-x previous-line M-x forward-word M-x backward-word M-x end-of-line M-x beginning-of-line M-x scroll up M-x scroll-down
Command Delete character Delete previous character Delete word Delete previous word Delete the entire line
Keystroke C-d DEL (or BACKSPACE on some keyboards) M-d M-DEL (or M-BACKSPACE on some keyboards) C-k
Command-Line M-x delete-char M-x delete-backward-char M-x kill-word M-x backward-kill-word M-x kill-line
Page 2 of 4
Command Mark the beginning of a selection Delete the marked region Copy a marked region Paste (Yank) a cut or copied a region
Command Incremental search forward* Incremental search backward* Exit incremental search* Cancel incremental search* Delete incorrect character in search string of incremental search* Non-incremental search forward Non-incremental search backward Start query replace Replace current instance and continue on to next instance Dont replace current instance, but move on to next instance
Keystroke C-s C-r <ENTER> or <RETURN> C-g DEL (or M-BACKSPACE on some keyboards) C-s RETURN (or ENTER on some keyboards) C-r RETURN (or ENTER on some keyboards) M-% SPACEBAR or y DEL (or M-BACKSPACE on some keyboards) or n . (period key)
Command-Line M-x isearch-forward M-x isearch-backward *None M-x keyboard-quit *None *None *None M-x query-replace *None *None
Replace the current instance and then quit *None Replace the current instance and then , (comma key) *None pause Resume after pausing SPACEBAR or y *None Replace remaining instances without asking ! *None Back up to previous instance ^ *None Exit query replace RETURN (or ENTER on some keyboards) or q *None *- NOTE: An incremental search is one in which the search begins as soon as you begin typing and continues search as you type additional characters.
Wildcard Searches
Page 3 of 4
Command Undoing recent changes Undo all changes since the last save Go back to an earlier version of the current file (the file as it appeared when you first opened it) Pop out to your Unix prompt Cancel current command
Keystroke C-x u *None C-x C-f filename~ RETURN (ENTER on some keyboards) FOLLOWED BY C-x C-w filename *None C-g
Page 4 of 4