Cover | Table of Contents
constant widthtype.
constant widthtype.
|
Major Mode | Function | ||
|---|---|---|---|
|
Fundamental mode |
The default mode; no special behavior | ||
|
Text mode |
For writing text | ||
|
Mail mode |
For writing mail messages | ||
|
RMAIL mode |
For reading and organizing mail | ||
|
View mode |
For viewing files but not editing | ||
|
Shell mode |
For running a UNIX shell within Emacs | ||
|
Telnet mode |
For logging in to remote systems | ||
|
Outline mode |
For writing outlines | ||
|
Indented text mode |
For indenting text automatically | ||
|
Nroff mode |
For formatting files for nroff | ||
|
TeX mode |
For formatting files for TeX | ||
|
LaTeX mode |
For formatting files for LaTeX | ||
|
C mode |
For writing C programs | ||
|
C++ mode |
For writing C++ programs | ||
|
Java mode |
For writing Java programs | ||
|
FORTRAN mode |
For writing FORTRAN programs | ||
|
Emacs LISP mode |
For writing Emacs LISP functions | ||
|
LISP mode |
For writing LISP programs | ||
|
LISP interaction mode |
For writing and evaluating LISP expressions |
Minor Mode |
Function |
|---|---|
|
Auto-fill mode |
Enables word wrap |
|
Overwrite mode |
Replaces characters as you type instead of inserting them |
|
Auto-save mode |
Saves your file automatically every so often in an auto-save file |
|
Abbrev mode |
Allows you to define word abbreviations |
|
Transient mark mode |
Highlights selected regions of text |
|
Outline mode |
For writing outlines |
|
VC mode |
For using various version control systems under Emacs |
(setq default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill)
To move |
Keystrokes
Command Name |
|---|---|
|
Forward one character | C-f
forward-char |
|
Backward one character | C-b
backward-char |
|
Up one line | C-p
previous-line |
|
Down one line (at the end of a file, creates a newline) | C-n
next-line |
|
Forward one word | ESC f
forward-word |
|
Backward one word | ESC b
backward-word |
|
To the beginning of the line | C-a
beginning-of-line |
|
To the end of the line | C-e
end-of-line |
|
Forward one screen | C-v
scroll-up |
|
Backward one screen | ESC v
scroll-down |
|
To the beginning of the file | ESC <
beginning-of-buffer |
|
To the end of the file |
ESC > end-of-buffer |
To |
Keystrokes
Command Name |
|---|---|
|
Repeat the following command n times | ESC n
digit-argument |
|
Repeat the following command 4 times | C-u
universal-argument |
|
Repeat the following command 16 times | C-u C-u
universal-argument |
|
Repeat a complex command (can edit arguments) | C-x ESC ESC
repeat-complex- command |
|
Recall previous command in minibuffer | ESC p
previous-history-element |
To delete |
Keystrokes
Command Name |
|---|---|
|
Character | C-d
delete-char |
|
Previous character | DEL
delete-backward-char |
|
Word | ESC d
kill-word |
|
Previous word | ESC DEL
|
To |
Keystrokes
Command Name |
|---|---|
|
Incremental search forward | C-s
isearch-forward |
|
Incremental search backward | C-r
isearch-backward |
|
Exit incremental search | RETURN |
|
Cancel incremental search | C-g
keyboard-quit |
|
Delete incorrect character of search string | DEL |
To |
Keystrokes |
|---|---|
|
Search forward | C-s RETURN |
|
Search backward | C-r RETURN |
|
Word search | C-s RETURN C-w |
To |
Keystrokes
Command Name |
|---|---|
|
Enter query-replace | ESC %
query-replace |
|
Replace and go on to the next instance | SPACE or y |
|
Don't replace; move on to next instance | DEL or n |
|
Replace the current instance and quit | . |
|
Replace and pause (SPACE or
y to move on) | , |
|
Replace the rest and don't ask | ! |
|
Back up to the previous instance | ^ |
|
Exit query-replace | RETURN or q |
|
Enter recursive edit | C-r |
|
Delete this instance and enter a recursive edit | C-w |
|
Exit recursive edit and resume query-replace | ESC C-c |
|
Exit recursive edit and exit query-replace | C-] |
|
Symbol |
Matches |
|---|---|
^ |
The beginning of a line |
$ |
The end of a line |
. |
Any single character (like ? in filenames) |
.* |
Any group of zero or more characters (like * in filenames) |
\< |
The beginning of a word |
\> |
The end of a word |
[] |
Any character specified within the brackets; for example, [a-z]
matches any alphabetic character |
To |
Keystrokes
Command Name |
|---|---|
|
Search for a regular expression forward | ESC C-s RETURN
re-search-forward |
|
Search for a regular expression backward | ESC C-r RETURN
re-search-backward |
|
Search incrementally forward for a regular expression | ESC C-s
isearch-forward-regexp |
|
Repeat incremental regular expression search |
To |
Keystrokes Command Name |
|---|---|
|
Move to the buffer specified | C-x b buffername
switch-to-buffer |
|
Display the buffer list | C-x C-b
list-buffers |
|
Delete the buffer specified | C-x k buffername
kill-buffer |
|
Ask about deleting each buffer | ESC x kill-some-buffers |
|
Change the buffer's name | ESC x rename-buffer |
|
Ask about saving each modified buffer | C-x s
save-some-buffers |
To |
Keystrokes |
|---|---|
|
Move to the next buffer | SPACE or n |
|
Move to the previous buffer | p |
|
Mark buffer for deletion | d or k |
|
Save buffer | s |
|
Unmark buffer | u |
|
Execute other one-letter commands on all marked buffers | x |
|
Unmark the previous buffer in the list | DEL |
|
Mark buffer as unmodified | ~ |
|
Toggle read-only status of buffer | % |
|
Display buffer in a full screen | 1 |
|
Display this buffer and the next one in horizontal windows | 2 |
|
Replace buffer list with this buffer | f |
|
Replace other window with this buffer | o |
|
Mark buffers to be displayed in windows | m |
|
Display buffers marked with m; Emacs makes as many windows as needed | v |
|
Quit buffer list | q |
To |
Keystrokes
Command Name |
|---|---|
|
Create two windows, one on top of the other | C-x 2
split-window-vertically |
|
Move to the other window | C-x o
other-window |
|
Delete the current window | C-x 0
delete-window |
|
Delete all windows but this one | C-x 1
delete-other-windows |
|
Make window taller | C-x ^
enlarge-window |
|
Make window shorter | ESC x shrink-window |
|
Scroll other window | ESC C-v
scroll-other-window |
|
Find a file in another other window | C-x 4 f
find-file-other-window |
|
Delete buffer and window (asks for confirmation) | C-x 4 0
kill-buffer-and-window |
To |
Keystrokes
Command Name |
|---|---|
|
Make a new frame | C-x 5 2
make-frame-command |
|
Move to another frame | C-x 5 o
other-frame |
|
Delete current frame | C-x 5 0
delete-frame |
|
Find file in a new frame | C-x 5 f
find-file-other-frame |
|
Make frame and display other buffer in it | C-x 5 b
switch-to-buffer-other- frame |
To |
Keystrokes
Command Name |
|---|---|
|
Enter shell mode | ESC x shell, |
|
Interrupt current job; equivalent to C-c in UNIX
shells | C-c C-c
comint-interrupt-subjob |
|
Delete a character; if at end of buffer send an EOF character | C-d
comint-delchar-or- maybe-eof |
|
Send EOF character | C-c C-d
comint-send-eof |
|
Erase current line; C-u> in UNIX shells | C-c C-u
comint-kill-input |
|
Suspend or stop a job; C-z in UNIX shells | C-c C-z
comint-stop-subjob |
|
Display previous command; repeat to display earlier commands | ESC p
comint-previous-input |
|
Display subsequent commands; repeat to display more recent commands | ESC n
comint-next-input |
|
Execute command on current line | RETURN
comint-send-input |
|
Complete command, filename, or variable name | TAB
comint-dynamic- complete |
|
Delete output from last command | C-c C-o
comint-kill-output |
|
Move last line of output to bottom of window | C-c C-e
comint-show-maximum- output |
To |
Keystrokes
Command Name |
|---|---|
|
Start Dired | C-x d
dired |
|
Copy | C
dired-do-copy |
|
Flag for deletion | d
dired-flag-file-deletion |
|
Delete immediately | D
dired-do-delete |
|
Open file or directory | e or f dired-find-file |
|
Reread the directory from disk | g
revert-buffer |
|
Change group permissions | G
dired-do-chgrp |
|
Remove line from display (don't delete it) | k
dired-do-kill-lines |
|
Mark with * | m
dired-mark |
|
Move to the next line | n
dired-next-line |
|
Find file in another window; move there | o
dired-find-file-other- window |
|
Find file in another window; don't move there | C-o
dired-display-file |
|
Print file | P
dired-do-print |
|
Quit Dired | q
dired-quit |
|
Query-replace string in marked files | Q
dired-do-query-replace |
|
Rename file | R
dired-do-rename |
|
Unmark file | u
dired-unmark |
|
View file | v
dired-view-file |
|
Delete files flagged with D | x
dired-do-flagged-delete |
|
Compress file | Z
dired-do-compress |
To |
Keystrokes |
|---|---|
|
Compose a mail message | C-x m |
|
Compose a mail message in another window | C-x 4 m |
|
Compose a mail message in another frame | C-x 5 m |
|
Insert contents of the .signature file | C-c C-w |
|
Send message | C-c C-c |
|
Define an alias for a name or a group of names | ESC x define-mail-alias |
To |
Keystrokes |
|---|---|
|
Read mail with RMAIL | ESC x rmail |
|
Scroll to the next screen of the message | SPACE |
|
Scroll to the previous screen of this message | DEL |
|
Move to the beginning of this message | . |
|
Move to the next message | n |
|
Move to the previous message | p |
|
Move to the first message | < |
|
Move to the last message | > |
|
Jump to a certain message (preface with the number of the message to
jump to) | j |
|
Flag this message for deletion and move forward | d |
|
Flag this message for deletion and move backward | C-d |
|
Undelete a message that has been flagged for deletion | u |
|
Delete all messages flagged for deletion | x |
|
Save message in RMAIL file format | o filename RETURN |
|
Save message as a standard ASCII text file | C-o filename RETURN. |
|
Display a window that lists all messages | h |
|
Exit RMAIL | q |
To |
Keystrokes |
|---|---|
|
Start Gnus | ESC x gnus |
|
Read articles in the group the cursor is on | SPACE |
|
Subscribe or unsubscribe to this group | u |
|
Prompt for a group to jump to | j |
|
List all newsgroups you subscribe to | l |
|
List groups that have been killed (killed groups are listed in the
.newsrc.eld file) | A k |
|
List all newsgroups available on this server | L |
|
Get new news | g |
|
Write a message for this group | a |
|
Exit news and update .newsrc file | q |
To |
Keystrokes |
|---|---|
|
Scroll forward | SPACE |
|
Scroll backward | DEL |
|
Move to the last posting you read | l |
|
Get the FAQ for this newsgroup | H f |
|
Move to the next article |
To |
Keystrokes
Command Name |
|---|---|
|
Start Telnet mode | ESC x telnet |
|
Depending on the context, send EOF or delete the character under the
cursor | C-d
comint-delchar-or- maybe-eof |
|
Process Telnet input | RETURN
telnet-send-input |
|
Interrupt current job; C-c in UNIX shells | C-c C-c
telnet-interrupt-subjob |
|
Send the next character quoted; similar to C-q | C-c C-q
send-process-next-char |
|
Send EOF character | C-c C-d
comint-send-eof |
|
Move first line of output to top of window | C-c C-r
comint-show-output |
|
Move last line of output to bottom of window | C-c C-e
comint-show-maximum- output |
|
Delete output from last command | C-c C-o
comint-kill-output |
|
Suspend or stop a job; C-z in UNIX shells | C-c C-z
telnet-c-z |
|
Erase current line; C-u in UNIX shells | C-c C-u
comint-kill-input |
|
Retrieve subsequent commands (can be repeated to find more recent
commands) | ESC n
comint-next-input |
|
Retrieve previous commands (can be repeated to find earlier commands) | ESC p
comint-previous-input |
ftp://cs.indiana.edu/pub/elisp/w3/w3.tar.gz.To |
Keystrokes
Command Name |
|---|---|
|
Center a line | ESC s
center-line |
|
Center a paragraph | ESC S
center-paragraph |
|
Center a region | ESC x center-region |
To |
Keystrokes
Command Name |
|---|---|
|
Delete a rectangle and store it | C-x r k
kill-rectangle |
|
Delete a rectangle; do not store it | C-x r d
delete-rectangle |
|
Insert the last rectangle killed | C-x r y
yank-rectangle |
|
Blank out the area marked as a rectangle; do not store it | C-x r c
clear-rectangle |
|
Insert a blank rectangle in the area marked | C-x r o
open-rectangle |
To |
Keystrokes
Command Name |
|---|---|
|
Move to the next heading | C-c C-n
outline-next-visible- heading |
|
Move to the previous heading | C-c C-p
outline-previous- visible-heading |
|
Move to the next heading of the same level | C-c C-f
outline-forward-same- level |
|
Move to the previous heading of the same level | C-c C-b
outline-backward-same- level |
|
Move up one heading level | C-c C-u
outline-up-heading |
|
Hide all body lines | C-c C-t
hide-body |
|
Hide subheads and bodies associated with a given heading | C-c C-d
hide-subtree |
|
Hide the body associated with a particular heading (not subheads and
their bodies) | ESC x hide-entry |
|
Hide the body of a particular heading and the bodies of all its
subheads | C-c C-l
hide-leaves |
|
Show everything that's hidden | C-c C-a
show-all |
To |
Keystrokes
Command Name |
|---|---|
|
Enter nroff mode | ESC x nroff-mode |
|
Move the cursor to the next text line | ESC n
forward-text-line |
|
Move the cursor to the previous text line | ESC p
backward-text-line |
|
Enter electric nroff mode (a minor mode in which you type the first
in a pair of nroff commands, then press C-j, and
Emacs inserts the second command of the pair) | ESC x electric-nroff-mode |
|
Complete common macro pairs | C-j
electric-nroff-newline |
To |
Keystrokes
Command Name |
|---|---|
|
Enter TeXmode | ESC x plain-tex-mode |
|
Enter LaTeX mode | ESC x latex-mode |
|
Insert two hard returns (standard end of paragraph) and check syntax
of paragraph | C-j
tex-terminate-paragraph |
|
Insert two braces and put cursor between them | C-c {
tex-insert-braces |
|
Position the cursor following the closing brace, if you are between
braces | C-c }
up-list |
|
Check buffer for syntax errors | ESC x validate-tex-buffer |
|
Process buffer in TeX or LaTeX | C-c C-b
tex-buffer |
|
Put the message shell on the screen, showing (at least) the last
error message | C-c C-l
tex-recenter-output- buffer |
|
Process region in Text or LaTeX | C-c C-r
tex-region |
|
Kill TeXor LaTeX processing | C-c C-k
tex-kill-job |
|
Print TeX or LaTeX output | C-c C-p
tex-print |
|
Show print queue | C- c C-q
tex-show-print-queue |
|
Provide closing element of a command pair, in LaTeX mode only | C-c C-e
tex-close-latex-block |
ftp://ftp.reed.edu/pub/src/html-helper-mode.tar.gz.% gunzip html-helper-mode.tar.gz % tar xvf html-helper-mode.tar
(setq load-path (cons "PUT_THE_PATH_HERE"
load-path))
(autoload 'html-helper-mode "html-helper-mode"
"Yay HTML" t)
(setq auto-mode-alist (cons '("\\.html$" .
html-helper-mode)auto-mode-alist))To |
Keystrokes
Command Name |
|---|---|
|
Start defining a macro | C-x (
start-kbd-macro |
|
End macro definition | C-x )
end-kbd-macro |
|
Execute last macro defined | C-x e
call-last-kbd-macro |
|
Execute the last macro defined n times | ESC n C-x e
digit-argument; call-last- kbd-macro |
|
Execute the last macro defined and then add keystrokes to it | C-u C-x (
universal-argument; start-kbd-macro |
|
Name the last macro created (a preface to saving it) | ESC x name-last-kbd-macro |
|
Save a named macro in a file | ESC x insert-keyboard-macro |
|
Load a named macro | ESC x load-file |
|
Execute a named macro | ESC macroname |
|
Insert a query in a macro definition | C-x q
kbd-macro-query |
|
Insert a recursive edit in a macro definition | C-u C-x q
universal argument; kbd-macro-query |
|
Exit a recursive edit | ESC C-c
exit-recursive-edit |
(define-key keymap "keystroke" 'command-name) (global-set-key "keystroke" 'command-name) (local-set-key "keystroke" 'command-name)
Special Character |
Definition |
|---|---|
|
\C-n |
C-n (where n is any letter) |
|
\C-[ or \e |
ESC |
|
\C-j or \n |
LINEFEED |
|
\C-m or \r |
RETURN |
|
\C-i or \T |
TAB |
(setq auto-save-interval 800)
Variable Default |
Description |
|---|---|
make-backup-files
t |
If t, create a backup version of the current file before saving it for the first time. |
backup-by-copying
nil |
If t, create backup files by copying rather than
renaming the file. The default is renaming, which is more efficient. |
version-control
nil |
If t, create numbered versions of files as
backups (with names of the form file-name~n~). If
nil, only do this for files that have numbered
versions already. If 'never, never make numbered
versions. |
kept-new-versions
2 |
Number of latest versions of a file to keep when a new numbered
backup is made. |
To |
Keystrokes
Command Name |
|---|---|
|
Indent each line between the cursor and mark | ESC C-\
indent-region |
|
Move to the first nonblank character on the line | ESC m
back-to-indentation |
|
Join this line to the previous one | ESC ^
delete-indentation |
|
Format and indent a comment | ESC ;
indent-for-comment |
To |
Keystrokes
Command Name |
|---|---|
|
Move to the beginning of the current statement | ESC a
c-beginning-of-statement |
|
Move to the end of the current statement | ESC e
c-end-of-statement |
|
Fill the paragraph, preserving indentations and decorations, if in
comment | ESC x c-fill-paragraph |
|
Move to the beginning of current function | ESC C-a
beginning-of-defun |
|
Move to the end of current function | ESC C-e
end-of-defun |
|
Put the cursor at the beginning of function, mark at the end | C-c RETURN
c-mark-function |
|
Indent the entire function according to indentation style | C-c C-q
c-indent-defun |
|
Indent a balanced expression according to indentation style | ESC C-q
c-indent-exp |
|
Toggle auto state, in which Emacs automatically indents or inserts
newlines when "electric" characters are typed ( { } : # ;
, / *) | C-c C-a
c-toggle-auto-state |
|
Toggle hungry state, in which Emacs deletes groups of spaces with a
single DEL | C-c C-d
c-toggle-hungry-state |
|
Toggle auto-hungry state, in which Emacs deletes groups of spaces and
the newline that precedes them with a single DEL | C-c C-t
c-toggle-auto-hungry- state |
|
Move to the beginning of the current preprocessor conditional | C-c C-u
c-up-conditional |
|
Move to the previous preprocessor conditional | C-c C-p
c-backward-conditional |
|
Move to the next preprocessor conditional | C-c C-n
c-forward-conditional |
|
Add and align backslashes at the end of each line in the region | C-c C-\
c-backslash-region |
|
Comment the current region | C-c C-c
comment-region |
Style |
Description |
|---|---|
|
cc-mode |
The default coding style, from which all others are derived |
To |
Keystrokes
Command Name |
|---|---|
|
Go to the next logical version control state | C-x v v
vc-next-action |
|
Show all registered files beneath a directory | C-x v d
vc-directory |
|
Generate a version difference report | C-x v =
vc-diff |
|
Throw away changes since the last checked-in revision | C-x v u
vc-revert-buffer |