Ubuntu 7.04 Eamcs学习

阅读更多

http://www.v2ex.com/topic/view/13988.html  Emacs23 安装
http://www.cnblogs.com/sirsunny/archive/2004/09/21/45114.html Emacs Lisp学习
http://debs.peadrop.com/ emacs-snapshot

Emacs常用快捷键:

1.移动:C-F C-B C-P C-N   M-F M-B C-a C-e M-> M-<

2.Buffer:C-x b , C-x C-b buffer list  buffer switch, C-x n Split windows,C-x k kill current buffer

3.save:C-x C-s, C-x C-w

4.C-x o ,C-M-v ,C-X 0 C-x 1

5.C-x 1 one window, C-x 2 horizontal windows , C-x 3 vertical windows, C-x 5 new frame

6.M-x shell,M-x eshell, M-p, M-n

7.C-x d, s,v,Enter f,e

8.search:C-s,C-r,C-M-s,C-M-r  incremental find & regexp find

   d,D,u,x,nC,R,!

9.M-x calendar,g d,

10.C-j,C-u or M-n C-x tab,C-M-o,M-s

Emacs快捷键整理 (以下信息来自:Learning GNU Emacs 3rd Edition)

一、移动

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.

M-}

forward-paragraph

Move forward one paragraph.

M-{

backward-paragraph

Move backward one paragraph.

C-v

scroll-up

Move forward one screen.

M-v

scroll-down

Move backward one screen.

C-x ]

forward-page

Move forward one page.

C-x [

backward-page

Move backward one page.

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.

C-l

recenter

Redraw screen with current line in the center.

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).

二、delete

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-k

kill-line

Delete from cursor to end of line.

M-k

kill-sentence

Delete next sentence.

C-x Del

backward-kill-sentence

Delete previous sentence.

C-y

yank

Restore what you've deleted.

C-wEdit Cut

kill-region

Delete a marked region (see next section).

(none)

kill-paragraph

Delete next paragraph.

(none)

backward-kill-paragraph

Delete previous paragraph.

三、Selecting and Pasting

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).

M-h

mark-paragraph

Mark paragraph.

C-x C-p

mark-page

Mark page.

C-x h

mark-whole-buffer

Mark buffer.

M-y

yank-pop

After C-y, pastes earlier deletion.

四、Search and replace

C-sEdit -> Search-> Incremental Search-> Forward String

isearch-forward

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

C-rEdit -> Search -> Incremental Search -> Backward String

isearch-backward

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

Enter

isearch-exit

In an incremental search , exit the search.

C-g

keyboard-quit

In an incremental search , cancel the search.

Del

isearch-delete-char

In an incremental search, delete character from search string.

C-s C-w

isearch-yank-word

Start an incremental search with the word the cursor is on as the search string.

C-s C-y

isearch-yank-line

Start an incremental search with the text from the cursor position to the end of the line as the search string.

C-s M-y

isearch-yank-kill

Start an incremental search with text from the kill ring as the search string.

C-s C-s

isearch-repeat-forward

Repeat previous search.

C-r C-r

isearch-repeat-backward

Repeat previous search backward.


C-s Enter searchstring EnterEdit -> Search -> String Forward

Start nonincremental search forward.

C-s

Repeat search forward.

C-r Enter searchstring EnterEdit -> Search -> String Backwards

Start nonincremental search backward.

C-r

Repeat search backward.

 Query Replace :  M-%

Responses during query-replace

Space or y

Replace searchstring with newstring and go to the next instance of the string.

Del or n

Don't replace; move to next instance.

.

Replace the current instance and quit.

,

Replace and let me see the result before moving on. (Press Space or y to move on.)

!

Replace all the rest and don't ask.

^

Back up to the previous instance.

Enter or q

Exit query-replace.

E

Modify the replacement string.

C-r

Enter a recursive edit (discussed in detail later).

C-w

Delete this instance and enter a recursive edit (so you can make a custom replacement).

C-M-c

Exit recursive edit and resume query-replace.

C-]

Exit recursive edit and exit query-replace.

 五、Regular Expression

^

Matches the beginning of a line.

$

Matches the end of a line.

.

Matches any single character (like ? in filenames).

.*

Matches any group of zero or more characters (. matches any character and * matches zero or more of the previous character).

\<

Matches the beginning of a word.

\>

Matches the end of a word.

[ ]

Matches any character specified within the brackets; for example, [a-z] matches any alphabetic character.

\s, \S

Matches any whitespace character: space, a newline, a tab, a carriage return, a formfeed, or a backspace; \S matches any character except whitespace.

\d, \D

Matches any single digit, 0-9; \D matches any character but a digit.

\w, \W

Matches any "word" character (upper- and lowercase letters, digits, and the underscore character); \W matches any character but these.


C-M-s EnterEdit -> Search -> Regexp Forward

re-search-forward

Search for a regular expression forward.

C-M-r EnterEdit -> Search ->Regexp Backwards

re-search-backward

Search for a regular expression backward.

C-M-sEdit -> Search -> Incremental Search -> Forward Regexp

isearch-forward-regexp

Search incrementally forward for a regular expression.

C-M-rEdit -> Search -> Incremental Search -> Backward Regexp

isearch-backward-regexp

Search incrementally backward for a regular expression.

C-M-%Edit -> Replace -> Replace Regexp

query-replace-regexp

Query-replace a regular expression.

(none)

replace-regexp

Globally replace a regular expression unconditionally (use with caution).


六、Indent text


C-j

newline-and-indent

Move to the next line and indent to the current level.

(none)

paragraph-indent-text-mode

A major mode for writing paragraphs with indented first lines and no blank lines between paragraphs.

(none)

paragraph-indent-minor-mode

The minor mode equivalent of paragraph-indent-text mode.

(none)

fill-individual-paragraphs

Reformat indented paragraphs, preserving indentation.

C-x Tab

indent-rigidly

Indent one column; preface with C-u or M-n to specify multiple columns.

C-M-\

indent-region

Indent a region to match the first line in the region.

M-m

back-to-indentation

Move the cursor to the first non-whitespace character on a line.

C-M-o

split-line

Split the line at the cursor position and indent it to the column of the cursor position.

(none)Edit -> Text Properties -> Indentation->  Indent More

increase-left-margin

Increase the left indentation level for the buffer by four characters by default.

(none)Edit->  Text Properties->  Indentation->  Indent Less

decrease-left-margin

Decrease the left indentation level for the buffer by four characters by default.

(none)Edit->  Text Properties->  ndentation->  Indent Right More

decrease-right-margin

Decrease the right indentation level for the buffer by four characters by default.

(none)Edit->  Text Properties->  Indentation->  Indent Left More

increase-right-margin

Increase the right indentation level for the buffer by four characters by default.

C-x .

set-fill-prefix

Use the information up to the cursor column as a prefix to each line of the paragraph; typing this command in column 1 cancels the fill prefix.




  • Ubuntu 7.04 Eamcs学习_第1张图片
  • 大小: 970 KB
  • Ubuntu 7.04 Eamcs学习_第2张图片
  • 大小: 668.7 KB
  • 查看图片附件

你可能感兴趣的:(Ubuntu,C,C++,C#,Emacs)