📄 refcard.tex
字号:
\threecol{sexp}{C-M-b}{C-M-f}\threecol{function}{C-M-a}{C-M-e}\threecol{go to buffer beginning (or end)}{M-<}{M->}}\key{scroll to next screen}{C-v}\key{scroll to previous screen}{M-v}\key{scroll left}{C-x <}\key{scroll right}{C-x >}\key{scroll current line to center of screen}{C-u C-l}\section{Killing and Deleting}\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr\threecol{{\bf entity to kill}}{{\bf backward}}{{\bf forward}}\threecol{character (delete, not kill)}{DEL}{C-d}\threecol{word}{M-DEL}{M-d}\threecol{line (to end of)}{M-0 C-k}{C-k}\threecol{sentence}{C-x DEL}{M-k}\threecol{sexp}{M-- C-M-k}{C-M-k}}\key{kill {\bf region}}{C-w}\key{copy region to kill ring}{M-w}\key{kill through next occurrence of {\it char}}{M-z {\it char}}\key{yank back last thing killed}{C-y}\key{replace last yank with previous kill}{M-y}\section{Marking}\key{set mark here}{C-@ {\rm or} C-SPC}\key{exchange point and mark}{C-x C-x}\key{set mark {\it arg\/} {\bf words} away}{M-@}\key{mark {\bf paragraph}}{M-h}\key{mark {\bf page}}{C-x C-p}\key{mark {\bf sexp}}{C-M-@}\key{mark {\bf function}}{C-M-h}\key{mark entire {\bf buffer}}{C-x h}\section{Query Replace}\key{interactively replace a text string}{M-\%}\metax{using regular expressions}{M-x query-replace-regexp}Valid responses in query-replace mode are\key{{\bf replace} this one, go on to next}{SPC}\key{replace this one, don't move}{,}\key{{\bf skip} to next without replacing}{DEL}\key{replace all remaining matches}{!}\key{{\bf back up} to the previous match}{^}\key{{\bf exit} query-replace}{RET}\key{enter recursive edit (\kbd{C-M-c} to exit)}{C-r}\section{Multiple Windows}When two commands are shown, the second is for ``other frame.''\key{delete all other windows}{C-x 1}{\setbox0=\hbox{\kbd{0}}\advance\hsize by 0\wd0\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr\threecol{split window, above and below}{C-x 2\ \ \ \ }{C-x 5 2}\threecol{delete this window}{C-x 0\ \ \ \ }{C-x 5 0}}}\key{split window, side by side}{C-x 3}\key{scroll other window}{C-M-v}{\setbox0=\hbox{\kbd{0}}\advance\hsize by 2\wd0\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr\threecol{switch cursor to another window}{C-x o}{C-x 5 o}\threecol{select buffer in other window}{C-x 4 b}{C-x 5 b}\threecol{display buffer in other window}{C-x 4 C-o}{C-x 5 C-o}\threecol{find file in other window}{C-x 4 f}{C-x 5 f}\threecol{find file read-only in other window}{C-x 4 r}{C-x 5 r}\threecol{run Dired in other window}{C-x 4 d}{C-x 5 d}\threecol{find tag in other window}{C-x 4 .}{C-x 5 .}}}\key{grow window taller}{C-x ^}\key{shrink window narrower}{C-x \{}\key{grow window wider}{C-x \}}\section{Formatting}\key{indent current {\bf line} (mode-dependent)}{TAB}\key{indent {\bf region} (mode-dependent)}{C-M-\\}\key{indent {\bf sexp} (mode-dependent)}{C-M-q}\key{indent region rigidly {\it arg\/} columns}{C-x TAB}\key{insert newline after point}{C-o}\key{move rest of line vertically down}{C-M-o}\key{delete blank lines around point}{C-x C-o}\key{join line with previous (with arg, next)}{M-^}\key{delete all white space around point}{M-\\}\key{put exactly one space at point}{M-SPC}\key{fill paragraph}{M-q}\key{set fill column}{C-x f}\key{set prefix each line starts with}{C-x .}\key{set face}{M-g}\section{Case Change}\key{uppercase word}{M-u}\key{lowercase word}{M-l}\key{capitalize word}{M-c}\key{uppercase region}{C-x C-u}\key{lowercase region}{C-x C-l}\section{The Minibuffer}The following keys are defined in the minibuffer.\key{complete as much as possible}{TAB}\key{complete up to one word}{SPC}\key{complete and execute}{RET}\key{show possible completions}{?}\key{fetch previous minibuffer input}{M-p}\key{fetch later minibuffer input or default}{M-n}\key{regexp search backward through history}{M-r}\key{regexp search forward through history}{M-s}\key{abort command}{C-g}Type \kbd{C-x ESC ESC} to edit and repeat the last command that used theminibuffer. Type \kbd{F10} to activate the menu bar using the minibuffer.\newcolumn\title{GNU Emacs Reference Card}\section{Buffers}\key{select another buffer}{C-x b}\key{list all buffers}{C-x C-b}\key{kill a buffer}{C-x k}\section{Transposing}\key{transpose {\bf characters}}{C-t}\key{transpose {\bf words}}{M-t}\key{transpose {\bf lines}}{C-x C-t}\key{transpose {\bf sexps}}{C-M-t}\section{Spelling Check}\key{check spelling of current word}{M-\$}\metax{check spelling of all words in region}{M-x ispell-region}\metax{check spelling of entire buffer}{M-x ispell-buffer}\section{Tags}\key{find a tag (a definition)}{M-.}\key{find next occurrence of tag}{C-u M-.}\metax{specify a new tags file}{M-x visit-tags-table}\metax{regexp search on all files in tags table}{M-x tags-search}\metax{run query-replace on all the files}{M-x tags-query-replace}\key{continue last tags search or query-replace}{M-,}\section{Shells}\key{execute a shell command}{M-!}\key{run a shell command on the region}{M-|}\key{filter region through a shell command}{C-u M-|}\key{start a shell in window \kbd{*shell*}}{M-x shell}\section{Rectangles}\key{copy rectangle to register}{C-x r r}\key{kill rectangle}{C-x r k}\key{yank rectangle}{C-x r y}\key{open rectangle, shifting text right}{C-x r o}\key{blank out rectangle}{C-x r c}\key{prefix each line with a string}{C-x r t}\section{Abbrevs}\key{add global abbrev}{C-x a g}\key{add mode-local abbrev}{C-x a l}\key{add global expansion for this abbrev}{C-x a i g}\key{add mode-local expansion for this abbrev}{C-x a i l}\key{explicitly expand abbrev}{C-x a e}\key{expand previous word dynamically}{M-/}\section{Regular Expressions}\key{any single character except a newline}{. {\rm(dot)}}\key{zero or more repeats}{*}\key{one or more repeats}{+}\key{zero or one repeat}{?}\key{quote regular expression special character {\it c\/}}{\\{\it c}}\key{alternative (``or'')}{\\|}\key{grouping}{\\( {\rm$\ldots$} \\)}\key{same text as {\it n\/}th group}{\\{\it n}}\key{at word break}{\\b}\key{not at word break}{\\B}\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr\threecol{{\bf entity}}{{\bf match start}}{{\bf match end}}\threecol{line}{^}{\$}\threecol{word}{\\<}{\\>}\threecol{buffer}{\\`}{\\'}\threecol{{\bf class of characters}}{{\bf match these}}{{\bf match others}}\threecol{explicit set}{[ {\rm$\ldots$} ]}{[^ {\rm$\ldots$} ]}\threecol{word-syntax character}{\\w}{\\W}\threecol{character with syntax {\it c}}{\\s{\it c}}{\\S{\it c}}}\section{International Character Sets}\metax{specify principal language}{M-x set-language-environment}\metax{show all input methods}{M-x list-input-methods}\key{enable or disable input method}{C-\\}\key{set coding system for next command}{C-x RET c}\metax{show all coding systems}{M-x list-coding-systems}\metax{choose preferred coding system}{M-x prefer-coding-system}\section{Info}\key{enter the Info documentation reader}{C-h i}\key{find specified function or variable in Info}{C-h C-i}\beginindentedkeysMoving within a node:\key{scroll forward}{SPC}\key{scroll reverse}{DEL}\key{beginning of node}{. {\rm (dot)}}Moving between nodes:\key{{\bf next} node}{n}\key{{\bf previous} node}{p}\key{move {\bf up}}{u}\key{select menu item by name}{m}\key{select {\it n\/}th menu item by number (1--9)}{{\it n}}\key{follow cross reference (return with \kbd{l})}{f}\key{return to last node you saw}{l}\key{return to directory node}{d}\key{go to any node by name}{g}Other:\key{run Info {\bf tutorial}}{h}\key{{\bf quit} Info}{q}\key{search nodes for regexp}{M-s}\endindentedkeys\section{Registers}\key{save region in register}{C-x r s}\key{insert register contents into buffer}{C-x r i}\key{save value of point in register}{C-x r SPC}\key{jump to point saved in register}{C-x r j}\section{Keyboard Macros}\key{{\bf start} defining a keyboard macro}{C-x (}\key{{\bf end} keyboard macro definition}{C-x )}\key{{\bf execute} last-defined keyboard macro}{C-x e}\key{append to last keyboard macro}{C-u C-x (}\metax{name last keyboard macro}{M-x name-last-kbd-macro}\metax{insert Lisp definition in buffer}{M-x insert-kbd-macro}\section{Commands Dealing with Emacs Lisp}\key{eval {\bf sexp} before point}{C-x C-e}\key{eval current {\bf defun}}{C-M-x}\metax{eval {\bf region}}{M-x eval-region}\key{read and eval minibuffer}{M-:}\metax{load from standard system directory}{M-x load-library}\section{Simple Customization}\metax{customize variables and faces}{M-x customize}% The intended audience here is the person who wants to make simple% customizations and knows Lisp syntax.Making global key bindings in Emacs Lisp (examples):\beginexample%(global-set-key "\\C-cg" 'goto-line)(global-set-key "\\M-\#" 'query-replace-regexp)\endexample\section{Writing Commands}\beginexample%(defun \<command-name> (\<args>) "\<documentation>" (interactive "\<template>") \<body>)\endexampleAn example:\beginexample%(defun this-line-to-top-of-window (line) "Reposition line point is on to top of window.With ARG, put point on line ARG." (interactive "P") (recenter (if (null line) 0 (prefix-numeric-value line))))\endexampleThe \kbd{interactive} spec says how to read arguments interactively.Type \kbd{C-h f interactive} for more details.\copyrightnotice\bye% Local variables:% compile-command: "tex refcard"% End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -