Sie sind auf Seite 1von 3

GNU Ema

s
Qui k Referen e Guide
for CS61A

C-SPC
M-
M-h

Bullets () mark a suggested starting set of ommands.


Daggers (y) denote key bindings that are not standard in
GNU Ema s. ARG denotes the pre x numeri argument
(entered with C-u or M-digit). The notation `C-x' means
\ ontrol-x", the result of holding down the ontrol key while
typing x. `M-x' means \meta-x", the result of holding down
the `Meta', Alt, or  key (depending on keyboard) while
typing x. If you are not using a window system or have a
keyboard without these keys, the sequen e of two hara ters
ESC x is equivalent. The notation `C-M-x' is equivalent to
holding down both ontrol and meta keys while typing x,
or of typing the two hara ters ESC C-x.

C-x h

Cursor motion.
C-f
C-b
M-f
M-b
C-e
C-a
C-M-f
C-M-b
M-e
M-f
M-a
M-g

Forward hara ter.


Ba kward hara ter.
Forward word.
Ba kward word.
Forward to end of line.
Ba kward to start of line.
Forward S-expression.
Ba kward S-expression.
Forward senten e.
Forward paragraph.
Ba kward senten e.
Ba kward paragraph.

C-n
Next line.
C-p
Previous line.
M-<
Beginning of bu er.
M->
End of bu er.
C-v
S roll text up one s reen (or ARG lines).
M-v
S roll text down (or ARG lines).
M-g
Go to line number ARG.y
M-x what-line Display line number.
C-M-v
S roll other window up one s reen (or ARG

lines).

Marking regions of text


C-
C-x C-x

Set mark at point.


Ex hange mark and point.

Same as C-.
Set mark after end of next word.
Set mark and point around urrent
paragraph.
Set mark and point around urrent bu er.

Deletion and yanking


DEL
M-DEL
C-d
M-d
C-k
C-w
M-w
M-n
M-SPC
C-x C-o
C-M-w
C-y
C-u C-y
M-y
M-w

Delete hara ter before ursor.


Delete word before ursor and add to kill
bu er.
Delete hara ter at ursor.
Delete word at and after ursor and add to
kill bu er.
Delete to end of line and add to kill bu er.
Delete urrent region, and add to kill bu er.
Copy urrent region to kill bu er without
deleting.
Delete surrounding blanks and tabs.
Delete all but one surrounding blank.
Delete all but one surrounding blank line.
Cause next ommand, if a kill, to append to
previous kill bu er, instead of new one.
Insert text from kill bu er at point.
Insert text from kill bu er at point without
moving point.
Repla e pre eding C-y text with next most
re ent kill bu er.
Copy region to kill bu er, no deletion.

Indentation
TAB
LFD
M-;
M-LFD
C-x TAB
C-M-n

Indent a ording to mode.


Same as RET TAB.
Indent and start omment.
Continue omment on next line.
Indent region rigidly by ARG.
Indent region a ording to mode.

Sear h
C-s
C-s C-s
C-r

41

Sear h forward.
Same as C-s with last string.
Sear h ba kward.

C-r
C-u
M-x
M-x
M-x

C-r
Same as C-r with last string.
C-s
Sear h forward for regular expression.
o ur Display lines mat hing a regular expression.
grep
Display results of UNIX grep utility.
ount-mat hes

The following sub ommands are valid during a sear h.


RET
End sear h.
DEL
Undo e e t of last sear h hara ter typed.
C-g
Abort sear h.
C-s
Sear h for next mat h forward.
C-r
Sear h for next mat h ba kward.
C-q
Quote next hara ter.
C-w
Extend sear h string with next word.
LFD
Extend sear h string with rest of line.

Repla ement
M-%
Query repla e.
M-x delete-mat hing-lines
M-x delete-non-mat hing-lines

Mat h opy of whatever mat hed nth group.

nn

Mis ellaneous editing


C-o
C-t
M-t
C-x C-t
M-u
M-l
M-

Insert newline after ursor.


Transpose hara ters.
Transpose words.
Transpose lines.
Convert whole word to upper ase.
Convert whole word to lower ase.
Capitalize word.

Files
C-x
C-x
C-x
C-x
C-x
M-x

C-f
Find le; load if needed.
4 C-f Find le in other window.
C-s
Save le.
C-w
Write to expli itly-named le.
i
Insert le at ursor.
re over-file Re over le after disaster from auto-

save le.

M-x revert-buffer Throw away hanges to bu er and re-

During a query-repla ement, the following are valid responses to prompts.


SPC
Make repla ement and go to next.
DEL
Skip repla ement and go to next.
RET
End repla ement.
!
Repla e all remaining instan es without C-x o
C-x 1
asking.
C-x 2
C-r
Enter re ursive edit; return with C-M- .

store from le.

Bu ers and windows

Regular expressions
.
^
$
[...
[^...
*
+
?

n
nb
nB
nj
n(...n)

Mat h any hara ter.


Mat h at start of line.
Mat h at end of line.
Mat h any hara ter in the `...'.
Mat h any hara ter ex ept those in `...'.
Mat h 0 or more of pattern to left.
Mat h 1 or more of pattern to left.
Mat h 0 or 1 of pattern to left.
Quotes , ex ept for the following.
Mat h at beginning or end of word.
Mat h ex ept at beginning or end of word.
Mat h either pattern to left or right.
Grouping.

C-x
C-x
C-x
C-x
C-x

b
0
3
C-b
k

Put ursor in other window.


Grow urrent window to full s reen.
Split urrent window verti ally.
Put named bu er in window.
Remove urrent window.
Split urrent window horizontally.
List all bu ers.
Delete bu er.

Shells
M-x shell Run UNIX shell in a bu er.
M-j
Exe ute single shell ommand on region.

With

ARG, repla es region.

Commands a tive in shell bu ers:


Send urrent line to shell.
Complete pre eding le name.
Send interrupt to shell.

RET
TAB
C- C-

42

C- C-u
C- C-z
C- C-d

Erase urrent input line.


Send stop signal to shell.
Send EOF to shell.

C-x SPC
C- C-i

In any sour e le, sets a break point.


Stepi.

Help and do umentation

S heme

M-x manual-entry UNIX man page for given topi .


C-h a
Look up names of mat hing Ema s

M-x run-s heme


Run S heme interpreter in bu er
*s heme*.
C- C-z
Put the ursor in bu er *s heme*.
C- C-e
Send de nition to *s heme*.
C- M-e
Same as C- C-e C- C-z.
C- C-l
Load le into *s heme*.
C- M-l
Same as C- C-l C- C-z.y
C- C-r
Send urrent region to *s heme*.
C- M-r
Same as C- C-r C- C-z.
M-C-q
Indent S heme expression.
M-C-n
Indent urrent region.
TAB
Indent the urrent line.
LFD
Same as RET TAB.

C-h
C-h
C-h
C-h
C-h
C-h
C-h
C-h

b
f
C-h
i
k
m
t
w

ommands.
Display key bindings.
Help for M-x fun tion.
Help for C-h.
Run info browser.
Help for key.
Help for urrent mode.
Tutorial.
Key ontaining fun tion.

Inside an *info* bu er (result of C-h i), the following are


de ned.
m
Sele t menu item.
l
Go to last-visited node.
?
Get help for browser.
u
Go
to node's parent.
M-x ompile Exe ute ommand (by default, make) asynn
Go
to
next node in sequen e.
hronously.
q
Leave
browser.

C-x `
Position to next error or next line found by
.
Go to top of node.
M-x grep ommand.
d
Go to top-level node.
M-x kill- ompiler Stop a tive ompile.

Compilation, debugging, and tags

M-x visit-tags-table Spe ify le ontaining tags produ ed by etags.


M-.
Display sour e for given tag.
C-u M-.
Find next alternate de nition for last tag.
C-x 4 .
Display sour e for tag in other window.
M-x tags-sear h
M-x tags-query-repla e Look for pattern in all les

named in tags table.

M-x tags-apropos Display mat hing tags.


M-x gdb

Run GNU debugger on le.

Mouse ommands
Left, middle, and right buttons are LB, MB, and RB.
LB
Put ursor at mouse. Dragging marks
region.
MB
Paste text from window-system ut bu er at
mouse.
RB
Extend region to pointer and opy into
ut and kill bu ers. Cli king twi e deletes
region.
C-LB
Sele t a bu er.

Commands valid in gdb mode.


C- C-s
Step.
C- C-n
Next.
C- <
Up sta k.
C- >
Down sta k.
C- C-r
Finish.
43

Das könnte Ihnen auch gefallen