[Emacs] Key Sequence and Describe
備忘,查詢用。
主要是整理自以前中研院的一份 pdf 檔,不過,現在好像 google 不到了?
Chapter 2 Emacs on-line help | |
---|---|
2.3 Ctrl-h Prefix | |
C-h c | describe-key-briefly |
C-h k | describe-key |
C-h w | where-is |
C-h a | apropos-command |
C-h v | describe-variable |
C-h i | info |
Chapter 4 About the Emacs | |
4.2 Exiting Emacs | |
C-x C-c | save-buffers-kill-emacs |
4.4 Buffers and Windows | |
M-x recovery-file | 'recovery-file' |
C-h v | describe-variable |
M-x set-variable | 'set-variable' |
C-x b | switch-to-buffer |
C-x k | 'kill-buffer' |
C-x C-b | list-buffers |
M-x buffer-menu | 'buffer-menu' |
C-x 0 | delete-window |
C-x 1 | delete-other-windows |
C-x 2 | split-window-vertically |
C-x 3 | split-window-horizontally |
C-x o | other-window |
C-x ^ | enlarge-window |
C-x } | enlarge-window-horizontally |
C-l | recenter |
Chapter 5 Basic Emacs Editing Commands | |
5.1 Loading/Saving File | |
M-x | execute-extended-command |
C-x C-f | find-file |
C-x i | insert-file |
M-x pwd | 'pwd' |
C-x C-s | save-buffer |
C-x C-w | write-file |
C-x s | save-some-buffers |
5.2 Emacs Basic Editing Command | |
M-x overwrite-mode | 'overwrite-mode' |
C-q | quoted-insert |
C-j | newline-and-indent |
C-f | forward-char |
C-b | backward-char |
M-f | forward-word |
M-b | backward-word |
C-a | move-beginning-of-line |
C-e | move-end-of-line |
C-n | next-line |
C-p | previous-line |
C-v | scroll-up |
M-v | scroll-down |
C-x < | scroll-left |
C-x > | scroll-right |
M-< | beginning-of-buffer |
M-> | end-of-buffer |
C-x [ | backward-page |
C-x ] | forward-page |
C-x C-p | mark-page |
M-x goto-char | 'goto-char' |
M-x goto-line | 'goto-line' |
C-u | universal-argument |
M-x what-page | 'what-page' |
C-x l | count-lines-page |
M-x what-line | 'what-line' |
C-x = | what-cursor-position |
M-= | count-lines-region |
M-x line-number-mode | 'line-number-mode' |
C-x u | advertised-undo |
C-d / <del> | delete-char |
DEL / | delete-backward-char |
M-\ | delete-horizontal-space |
M-SPC | just-one-space |
M-d | kill-word |
M-DEL | backward-kill-word |
C-k | kill-line |
C-x C-o | delete-blank-lines |
5.3 Yanking | |
C-y | yank |
M-y | yank-pop |
5.4 Marking Text | |
C-@ | set-mark-command |
C-SPC | set-mark-command |
C-x C-x | exchange-point-and-mark |
C-x C-p | mark-page |
C-w | kill-region |
C-x r s | copy-to-register |
C-x C-l | downcase-region |
C-x C-u | upcase-region |
5.5 Moving Text and Copying Text | |
C-x k | kill-buffer |
M-w | kill-ring-save |
C-x r d | delete-rectangle |
C-x r k | kill-rectangle |
C-x r y | yank-rectangle |
C-x r o | open-rectangle |
M-x clear-rectangle | 'clear-rectangle' |
M-x string-rectangle | 'string-rectangle' |
5.6 Undoing Change | |
C-x u | advertised-undo |
C-/ | undo |
C-_ | undo |
Chapter 6 Advanced Emacs Editing Commands | |
6.1 Searching Text | |
C-s | isearch-forward |
C-r | isearch-backward |
C-g | keyboard-quit |
C-M-s / | isearch-forward-regexp |
C-M-r / | isearch-backward-regexp |
6.2 Replacing Text | |
M-x replace-string | 'replace-string' |
M-x replace-regexp | 'replace-regexp' |
M-x query-replace | 'query-replace' |
M-x query-replace-regexp | 'query-replace-regexp' |
6.3 Regular Expression | |
. | 代表除了newline外的任一個字元 |
* | 字元重複的次數,從0次到無限多次 |
+ | 字元重複的次數,從1次到無限多次 |
? | 字元重複的次數,不是0次就是1次 |
[...] | 字集 |
[^...] | ^出現在字集的第一個字元,表示以下皆非的意思 |
[.-.] | 簡化範圍性的字集的表示法 |
^ | 表示列首 |
$ | 表示列尾 |
\ | 跳脫字元 |
\| | 表示選擇的用法 |
\(...\) | 將範圍規範出來,並置入緩衝區 |
\d | d表數字。把緩衝區的內容取出來 |
\< | 尋找word的開頭 |
\> | 尋找word的結尾 |
閱讀全文 ...