This is a crib sheet of emacs commands that I find useful. If you want a
complete list of key bindings, just type: C-h b
If you want info on any of the particular bindings below, you can use emacs
help in either of these two ways:
C-h k key-sequence (e.g., C-h k C-x C-v)
C-h f function-name (e.g., C-h f find-alternate-file)
Anytime you make a mistake and want to stop a key sequence just use C-g.
Guide to Key Sequences
--------------------------
C Control Key
M Meta Key = Esc (also Alt on most Windows keyboards)
C-x Control and x
C-x f Control and x followed by f
C-x C-s Control and x followed by Control and s
M-f Meta and f
M-C-s Control and Meta and s
M-0 .. M-9 digit-argument
C-g keyboard-quit (stop a key sequence)
Files
---------
C-x C-f find-file
C-x C-r find-file-read-only
C-x C-w write-file
C-x i insert-file
C-x C-v find-alternate-file (kills current buffer)
C-x 4 f find-file-other-window
C-x 4 r find-file-read-only-other-window
Buffers
-----------
C-x C-s save-buffer
C-x C-c save-buffers-kill-emacs
C-x k kill-buffer
C-x C-q vc-toggle-read-only (make buffer read-only)
C-x C-b list-buffers
C-x b switch-to-buffer
C-x s save-some-buffers
M-~ not-modified (mark buffer as unmodified)
Moving Around
-----------------
M-& beginning-of-buffer
M-< end-of-buffer
C-a beginning-of-line
C-e end-of-line
M-b backward-word (also C-left or M-left)
M-f forward-word (also C-right or M-right)
M-a backward-sentence
M-e forward-sentence
M-{ backward-paragraph (also C-up)
M-} forward-paragraph (also C-down)
C-v scroll-up
M-v scroll-down
M-PGUP scroll-other-window-down (up! it's nuts!)
M-PGDN scroll-other-window (down!)
M-m back-to-indentation
C-l recenter
Changing Case
-----------------
M-c capitalize-word
M-u upcase-word
M-l downcase-word
C-x C-u upcase-region
C-x C-l downcase-region
Editing
-----------
C-d delete-char
M-d kill-word (also C-DEL)
M-DEL backward-kill-word (also C-BKSPC)
C-k kill-line
M-k kill-sentence
C-t transpose-chars
M-t transpose-words
C-x C-t transpose-lines
C-o open-line
C-x C-o delete-blank-lines
M-i tab-to-tab-stop
M-q fill-paragraph
Cut-Copy-Paste
------------------
C-SPC set-mark-command
C-w kill-region (also S-DEL)
M-w kill-ring-save (copy to kill-ring)
C-y yank
M-y yank-pop (after C-y, yanks previous kills)
M-h mark-paragraph
C-x h mark-whole-buffer
C-x C-x exchange-point-and-mark
|
Searching
-------------
C-r isearch-backward
C-s isearch-forward
M-C-r isearch-backward-regexp
M-C-s isearch-forward-regexp
Replacing
-------------
M-% query-replace
M C-% query-replace-regexp
Responses During Query Replace
----------------------------------
y replace this instance
n dont replace this one
! replace all remaining instances
. replace this one and exit
, replace but leave point here
^ back up to previous replacement
C-r recursive edit
C-M-c exit-recursive-edit
? help
q exit
Macro Commands
------------------
C-x ( start-kbd-macro
C-x ) end-kbd-macro
C-x e call-last-kbd-macro
C-x q kbd-macro-query
C-x C-k edit-kbd-macro
Windows
-----------
C-x 0 delete-window
C-x 1 delete-other-windows
C-x 2 split-window-vertically
C-x 3 split-window-horizontally
C-x o other-window
C-x - shrink-window-if-larger-than-buffer
C-x ^ enlarge-window
C-x { shrink-window-horizontally
C-x } enlarge-window-horizontally
C-x + balance-windows
Sundry
----------
C-x z repeat
C-_ undo
C-x u advertised-undo
M-! shell-command
C-q quoted-insert
M-= count-lines-region
C-x l count-lines-page
C-u universal-argument
(followed by ### and command)
C-x f set-fill-column
(Set to 80: M-8 M-0 C-x f)
Spell Checker
-----------------
M-$ ispell-word
i accept and insert into dictionary
a accept for this session only
SPC accept just this once
Help Commands
-----------------
C-h ? help-for-help
C-h q help-quit
C-h v describe-variable
C-h f describe-function
C-h k describe-key
C-h c describe-key-briefly
C-h a apropos-command
C-h b describe-bindings
C-h m describe-mode
C-h F view-emacs-FAQ
|
Custom Bindings
-------------------
C-x c kill-line-backwards (M-0 C-k does the same)
C-x g goto-line
C-x t toggle-truncate-lines
C-x w count-words-region
C-$ ispell-buffer
[Home] beginning-of-buffer
[End] end-of-buffer