home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeLinux in a NutshellSearch this book

10.4. Summary of Commands by Key

Emacs commands are presented next in two alphabetical lists. Tables list keystrokes, command name, and description. C- indicates the Ctrl key; M- indicates the Meta key.

10.4.1. Control-Key Sequences

Binding Command Action


Mark the beginning (or end) of a region.

C-Space (Same as preceding) (Same as preceding)
C-] abort-recursive-edit

Exit recursive edit and exit query-replace.

C-a beginning-of-line Move to beginning of line.
C-b backward-char

Move backward one character (left).

C-c C-c interrupt-shell-subjob Terminate the current job.
C-c C-d shell-send-eof End-of-file character.
C-c C-u kill-shell-input Erase current line.
C-c C-w backward-kill-word Erase the previous word.
C-c C-z stop-shell-subjob Suspend the current job.
C-d delete-char Delete character under cursor.
C-e end-of-line Move to end of line.
C-f forward-char

Move forward one character (right).

C-g keyboard-quit Abort current command.
C-h help-command Enter the online help system.
C-h a command-apropos

What commands involve this concept?

C-h b describe-bindings

What are all the key bindings for this buffer?

C-h c describe-key-briefly

What command does this keystroke sequence run?

C-h C-c describe-copying View the Emacs General Public License.
C-h C-d describe-distribution

View information on ordering Emacs from the FSF.

C-h C-w describe-no-warranty View the (non)warranty for Emacs.
C-h f describe-function What does this function do?
C-h i info Start the Info documentation reader.
C-h k describe-key

What command does this keystroke sequence run, and what does it do?

C-h l view-lossage What are the last 100 characters I typed?
C-h m describe-mode

Tell me about the mode the current buffer is in.

C-h n view-emacs-news

View news about updates to Emacs.

C-h s describe-syntax What is the syntax table for this buffer?
C-h t help-with-tutorial Run the Emacs tutorial.
C-h v describe-variable

What does this variable mean, and what is its value?

C-h w where-is

What is the key binding for this command?

C-k kill-line Delete from cursor to end-of-line.
C-l recenter

Redraw screen with current line in the center.

C-n next-line

Move to next line (down).

C-p previous-line

Move to previous line (up).

C-q quoted-insert

Insert next character typed. Useful for inserting a control character.

C-r isearch-backward

Start or repeat nonincremental search backward.

C-r (none)

Enter recursive edit (during query replace).

C-s isearch-forward

Start or repeat nonincremental search forward.

C-t transpose-chars Transpose two letters.
C-u n universal-argument Repeat the next command n times.
C-u C-x ( start-kbd-macro

Execute last macro defined, then add keystrokes.

C-u C-x q (none) Insert recursive edit in a macro definition.
C-v scroll-up Move forward one screen.
C-w kill-region Delete a marked region.
C-x ( start-kbd-macro Start macro definition.
C-x ) end-kbd-macro End macro definition.
C-x [ backward-page Move backward one page.
C-x ] forward-page Move forward one page.
C-x ^ enlarge-window Make window taller.
C-x {

shrink-window- horizontally

Make window narrower.
C-x }

enlarge-window- horizontally

Make window wider.
C-x < scroll-left Scroll the window left.
C-x > scroll-right Scroll the window right.
C-x . set-fill-prefix

Prepend each line in paragraph with characters from beginning of line up to cursor column; cancel prefix by typing this command in column 1.

C-x 0 delete-window Delete current window.
C-x 1


Delete all windows but this one.
C-x 2


Divide current window in two vertically, resulting in one window on top of the other.

C-x 3


Divide current window in two horizontally, resulting in two side-by-side windows.

C-x 4 b


Select a buffer in the other window.

C-x 4 f


Find a file in the other window.
C-x 5 b


Select a buffer in another frame.

C-x 5 f find-file-other-frame

Find a file in a new frame.

C-x a -


Define previous word as global (mode- independent) abbreviation.

C-x a i l


Define previous word as mode-specific abbreviation.

C-x b switch-to-buffer Move to the buffer specified.
C-x C-b list-buffers Display the buffer list.
C-x C-c save-buffers-kill-emacs Exit Emacs.
C-x C-f find-file Find file and read it.
C-x C-l downcase-region Lowercase region.
C-x C-p mark-page Place cursor and mark around whole page.
C-x C-q (none) Toggle read-only status of buffer.
C-x C-s save-buffer

Save file. (If terminal hangs, C-q restarts.)

C-x C-t transpose-lines Transpose two lines.
C-x C-u upcase-region Uppercase region.
C-x C-v find-alternate-file

Read an alternate file, replacing the one currently in the buffer.

C-x C-w write-file Write buffer contents to file.
C-x C-x


Exchange location of cursor and mark.
C-x Del

backward-kill- sentence

Delete previous sentence.
C-x e call-last-kbd-macro Execute last macro defined.
C-x h mark-whole-buffer

Place cursor and mark around whole buffer.

C-x i insert-file Insert file at cursor position.
C-x k kill-buffer Delete the buffer specified.
C-x o other-window

Move to the other window.

C-x q kbd-macro-query Insert a query in a macro definition.
C-x s save-some-buffers

Ask whether to save each modified buffer.

C-x u advertised-undo

Undo last edit (can be done repeatedly).

C-y yank Restore what you've deleted.
C-z suspend-emacs

Suspend Emacs (use exit or fg to restart).

10.4.2. Meta-Key Sequences

Binding Command Action
M-- M-c

negative-argument; capitalize-word

Capitalize previous word.
M-- M-l

negative-argument; downcase-word

Lowercase previous word.
M-- M-u

negative-argument; upcase-word

Uppercase previous word.
M-$ spell-word Check spelling of word after cursor.


Move to beginning of file.
M-> end-of-buffer Move to end-of-file.
M-{ backward-paragraph Move backward one paragraph.
M-} forward-paragraph Move forward one paragraph.
M-^ delete-indentation Join this line to the previous one.
M-n digit-argument

Repeat the next command n times.

M-n C-x e

digit-argument; call-last-kbd-macro

Execute the last defined macro n times.

M-a backward-sentence Move backward one sentence.
M-b backward-word Move one word backward.
M-c capitalize-word Capitalize first letter of word.
M-C-\ indent-region

Indent a region to match first line in region.

M-C-c exit-recursive-edit Exit a recursive edit.
M-C-o split-line

Split line at cursor; indent to column of cursor.

M-C-r isearch-backward-regexp

Incremental search backward for regular expression.

M-C-s isearch-forward-regexp

Incremental search forward for regular expression.

M-C-v scroll-other-window Scroll other window.
M-d kill-word Delete word that cursor is on.
M-Del backward-kill-word Delete previous word.
M-e forward-sentence Move forward one sentence.
M-f forward-word Move one word forward.
(none) fill-region

Reformat individual paragraphs within a region.

M-h mark-paragraph

Place cursor and mark around whole paragraph.

M-k kill-sentence Delete sentence the cursor is on.
M-l downcase-word Lowercase word.
M-m back-to-indentation

Move cursor to first nonblank character on line.

M-q fill-paragraph Reformat paragraph.
M-t transpose-words Transpose two words.
M-u upcase-word Uppercase word.
M-v scroll-down Move backward one screen.
M-x (none) Execute a command by typing its name.

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.