Emacs编辑命令速查表1【摘自Learning Gnu Emacs】

来源:互联网 发布:数据迁移方案101data 编辑:程序博客网 时间:2024/05/18 02:02

Table E-1. File-handling commands (Chapter 1)

Keystrokes

Command name

Action

C-x C-fFile  Open File

find-file

Find file and read it in a new buffer.

C-x C-v

find-alternate-file

Read an alternate file, replacing the one read with C-x C-f.

C-x iFile  Insert File

insert-file

Insert file at cursor position.

C-x C-s File  Save (current buffer)

save-buffer

Save file.

C-x C-w File  Save Buffer As

write-file

Write buffer contents to file.

C-x C-c File  Exit Emacs

save-buffers-kill-emacs

Exit Emacs.


Table E-2. Cursor movement commands (Chapter 2)

Keystrokes

Command name

Action

C-f

forward-char

Move forward one character (right).

C-b

backward-char

Move backward one character (left).

C-p

previous-line

Move to previous line (up).

C-n

next-line

Move to next line (down).

M-f

forward-word

Move one word forward.

M-b

backward-word

Move one word backward.

C-a

beginning-of-line

Move to beginning of line.

C-e

end-of-line

Move to end of line.

M-e

forward-sentence

Move forward one sentence.

M-a

backward-sentence

Move backward one sentence.

C-v

scroll-up

Move forward one screen.

M-v

scroll-down

Move backward one screen.

M-<

beginning-of-buffer

Move to beginning of file.

M->

end-of-buffer

Move to end of file.

(none)

goto-line

Go to line n of file.

(none)

goto-char

Go to character n of file.

M-n

digit-argument

Repeat the next command n times.

C-u n

universal-argument

Repeat the next command n times (four times if you omit n).


Table E-3. Deleting, yanking, region, and clipboard commands(Chapter 2)

Keystrokes

Command name

Action

C-d

delete-char

Delete character under cursor.

Del

delete-backward-char

Delete previous character.

M-d

kill-word

Delete next word.

M-Del

backward-kill-word

Delete previous word.

C-yEdit  Paste Most Recent

yank

Restore what you've deleted.

C-w Edit  Cut

kill-region

Delete a marked region (see next section).

C-@ or C- Space

set-mark-command

Mark the beginning (or end) of a region.

C-x C-x

exchange-point-and-mark

Exchange location of cursor and mark.

C-w

kill-region

Delete the region.

C-y

yank

Paste most recently killed or copied text.

M-w

kill-ring-save

Copy the region (so it can be pasted with C-y).

C-x h

mark-whole-buffer

Mark buffer.

M-y

yank-pop

After C-y, pastes earlier deletion.

(none)

clipboard-kill-region

Cut region and place both in kill ring and on system clipboard.

(none)

clipboard-yank

Paste text from clipboard.

(none)

clipboard-kill-ring-save

Copy text to clipboard.


Table E-4. Text filling and reformatting commands (Chapter 2)

Keystrokes

Command name

Action

(noneOptions  Word Wrap in Text Modes

auto-fill-mode

Toggle auto-fill mode, in which Emacs formats paragraphs as you type them.

M-q

fill-paragraph

Reformat paragraph.

(noneEdit  Fill

fill-region

Reformat individual paragraphs within a region.


Table E-5. Stopping and undoing commands (Chapter 2)

Keystrokes

Command name

Action

C-g

keyboard-quit

Abort current command.

C-x u

advertised-undo

Undo last edit (can be done repeatedly).

C-_ Edit  Undo

undo

Undo last edit.

(none)

revert-buffer

Restore buffer to the state it was in when the file was last saved (or auto-saved).


Table E-6. Search and replace commands (Chapter 3)

Keystrokes

Command name

Action

C-s Edit  Search  Incremental Search  Forward String

isearch-forward

Start incremental search forward; follow by search string. Also, find next occurrence (forward) of search string.

C-r Edit  Search  Incremental Search  Backward String

isearch-backward

Start incremental search backward; follow by search string. Also, find next occurrence (backward) of search string.



原创粉丝点击