|
|
1.1 root 1: .\" Emacs reference card. To print: tbl refcard.troff | troff -*-nroff-*-
2: .\" Original by Neal Ziring, Washington Univ. (St. Louis)
3: .\" Version 17 revisions by Paul Rubin, UC Berkeley
4: .\" Adjusted so it works with vtroff fonts by mit-erl!gildea 5 Feb 86
5: .ds CH
6: .ds CF
7: .\" define help character
8: .ds HC C-h
9: .nr PS 9
10: .ps 9
11: .nr VS 11
12: .vs 11
13: .nr HM .50i
14: .nr FM .25i
15: .nr PO 0.6i
16: .po 0.6i
17: .nr LL 4i
18: .ll 4i
19: .de hD
20: 'sp |0.5i
21: ..
22: .de fO
23: 'bp
24: ..
25: .wh 0 hD
26: .wh -0.2i fO
27: .de nc
28: .bp
29: ..
30: .de LG
31: .ps +2
32: ..
33: .de SM
34: .ps -2
35: ..
36: .de B
37: .ft B
38: ..
39: .de I
40: .ft I
41: ..
42: .de R
43: .ft R
44: ..
45: .de h
46: .LG
47: .B
48: \\$1
49: .R
50: .SM
51: ..
52: .fi
53: .\" side 1
54: .ne 0.2i
55: .LG
56: .LG
57: .B
58: .ce
59: GNU Emacs Quick Reference
60: .sp 0.5
61: .I
62: .SM
63: .ce
64: (version 17)
65: .sp 1.25
66: .R
67: .SM
68: Emacs (\fBE\fR-maks) \- full-screen real-time text editor
69: .sp 1.25
70: .h "Entering and Leaving GNU Emacs"
71: .sp 0.5
72: .in +2n
73: \fRemacs\fI file ...\fR
74: .sp 0.25
75: ^Z Stop Emacs for later resumption
76: .sp 0.25
77: ^X ^C Quit Emacs and return to shell
78: .R
79: .in -2n
80: .sp 1
81: .TS
82: lp+2fB s
83: a l.
84: GNU EMACS CONCEPTS
85: .sp 0.5
86: Insertion T{
87: .na
88: .ll 2.8i
89: You are always in
90: insert mode in Emacs.
91: Ordinary text is inserted
92: as it is typed.
93: T}
94: .sp 0.5
95: Commands T{
96: .na
97: .ll 2.8i
98: Emacs commands are invoked by
99: typing sequences of control
100: characters. Control
101: chars are written \fIC-x\fP,
102: escape sequences \fIESC x\fP.
103: T}
104: .sp 0.5
105: Buffer T{
106: .na
107: .ll 2.8i
108: A block of
109: text that you may
110: examine and modify
111: in the editor.
112: T}
113: .sp 0.5
114: Window T{
115: .na
116: .ll 2.8i
117: An area on the screen.
118: A buffer can be displayed
119: in one or more windows.
120: T}
121: .sp 0.5
122: File T{
123: .na
124: .ll 2.8i
125: A block of text that can be read into
126: a buffer or written from a buffer.
127: T}
128: .sp 0.5
129: Kills T{
130: .na
131: .ll 2.8i
132: Text that is \fIkilled\fP is placed
133: in a special kill-buffer.
134: Killed text can be retrieved with a \fIyank\fP.
135: The most recent sixteen kills are kept in the \fIkill-ring\fP.
136: T}
137: .sp 0.5
138: Point T{
139: .na
140: .ll 2.8i
141: The current cursor location
142: in each buffer is called
143: \fIpoint\fP (formerly \fIdot\fP).
144: T}
145: .sp 0.5
146: Mark T{
147: .na
148: .ll 2.8i
149: The \fImark\fP is an invisible pointer in
150: each buffer.
151: It is set by many commands to the
152: location where they were performed.
153: T}
154: .sp 0.5
155: Region T{
156: .na
157: .ll 2.8i
158: Text between the \fIpoint\fR
159: and the \fImark\fR is called the
160: \fIregion\fP.
161: T}
162: .sp 0.5
163: Registers T{
164: .na
165: .ll 2.8i
166: Emacs has 26
167: general registers, named \fIa\fR
168: through \fIz\fR. Registers may hold
169: commands, locations, numbers, or text.
170: T}
171: .sp 0.5
172: Modes T{
173: .na
174: .ll 2.8i
175: Every buffer has a major mode,
176: and maybe some minor modes.
177: \fIMajor\fP modes determine
178: language-sensitive behavior
179: and define special mode commands.
180: \fIMinor\fP modes add special features
181: without adding new commands.
182: T}
183: .sp 0.25
184: .TE
185: .sp 1
186: .TS
187: expand;
188: lp+2fB s
189: a l
190: l s
191: afB l.
192: GETTING HELP
193: .sp 0.25
194: \*(HC Invoke the self-documenter
195: .sp 0.25
196: T{
197: .na
198: .ll 3.9i
199: .in +1n
200: The self-documenter function will prompt
201: for a help command. Most help commands
202: ask for a name or character, which they
203: will then describe for you.
204: .in -1n
205: .ad
206: T}
207: .sp 0.25
208: \*(HC a document functions apropos a word
209: \*(HC b list all key bindings
210: \*(HC c describe a key sequence briefly
211: \*(HC f describe a function
212: \*(HC k describe a key sequence completely
213: \*(HC l show last 100 characters typed
214: \*(HC m describe this major mode
215: \*(HC v describe a variable
216: \*(HC ? show list of help commands
217: \*(HC t visit a friendly Emacs tutorial
218: \*(HC i invoke Info documentation reader
219: .TE
220: .bp
221: .ne 0.3i
222: .\" side 1 column 2
223: .TS
224: lp+2fB s
225: a l
226: a l
227: l s.
228: SPECIFYING YOUR TERMINAL TYPE
229: .sp 0.25
230: setenv TERM \fItype\fR in \fIcsh\fR
231: TERM=\fItype\fR ; export TERM in \fIsh\fR
232: .sp 0.25
233: \ here \fItype\fR=hp2621, vt100, etc.
234: \ see also \fItset(1)\fR and \fIenviron(7)\fR
235: .TE
236: .sp 1
237: .TS
238: lp+2fB s
239: a l.
240: VARIABLES AND OPTIONS
241: .sp 0.25
242: \*(HC\ v T{
243: .na
244: .ll 2.5i
245: Describe a variable.
246: The variable's value
247: and description will
248: be displayed.
249: .ad
250: T}
251: .sp 0.25
252: ESC x set-var T{
253: .na
254: .ll 2.5i
255: Set a variable to a value,
256: you will be prompted for
257: the variable name and new
258: value.
259: .ad
260: T}
261: .sp 0.25
262: ESC x edit-opt T{
263: .na
264: .ll 2.5i
265: Open a buffer to view and set
266: options interactively.
267: T}
268: .TE
269: .sp 0.75
270: .ti 5n
271: .fi
272: GNU Emacs maintains a large number of
273: variables that define many of its
274: operating characteristics. You
275: can examine and modify these variables
276: using the commands given above.
277: .sp 1
278: .TS
279: expand;
280: lp+2fB s s
281: c c c
282: c c c
283: a l l.
284: USEFUL VARIABLES
285: .sp 0.25
286: Variable Initial Description
287: Name Value
288: .sp 0.25
289: auto-save-default t auto-save files
290: auto-save-interval 300 chars between saves
291: blink-matching-paren t show paren matches
292: c-indent-level 2 C statement indent
293: c-label-offset -2 relative label indent
294: case-fold-search t searches ignore case
295: case-replace t replace preserves case
296: comment-column 32 column to start comments
297: comment-start None string to start comments
298: fill-column 70 fill text to column
299: indent-tabs-mode t indent can use tabs
300: scroll-step 0 scroll by when moving
301: tab-width 8 width of tab char in display
302: .TE
303: .sp 1
304: .TS
305: expand;
306: lp+2fB s
307: l s
308: l s
309: l s
310: ae le.
311: REGULAR EXPRESSIONS
312: .sp 0.25
313: .in +2n
314: Some Emacs commands use regular expressions
315: for string pattern matching. Common commands
316: that use this are the following.
317: .in -2n
318: .sp 0.5
319: isearch-backward-regexp replace-regexp
320: isearch-forward-regexp query-replace-regexp
321: command-apropos
322: .sp 0.75
323: .TE
324: .TS
325: expand;
326: l s
327: l s
328: ap+2fI l
329: afI l.
330: .in +2n
331: The following primitives are recognized by the Emacs
332: pattern matcher.
333: .in -2n
334: .sp 0.25
335: \ ^ beginning of line
336: \ . any character except newline
337: \ $ end of line
338: [str] any char in \fIstr\fR
339: [^str] ...not in \fIstr\fR
340: [X-Y] ...in range \fIX\fR to \fIY\fR
341: \e` beginning of buffer
342: \e' end of buffer
343: \eb beginning or end of word
344: \eB \fBnot\fR beginning or end of word
345: \ew any word-constituent character
346: \eW any non-word-constituent character
347: \ * zero or more of preceding regexp
348: \ + one or more of preceding regexp
349: \ ? zero or one of preceding regexp
350: \e| alternation of two patterns
351: \e(\ \e) parentheses for expression grouping
352: \e0...\e9 remember \fIn\fRth regexp in \e( \e)
353: .TE
354: .bp
355: .\" side 1 column 3
356: \" .ne 0.2i
357: .TS
358: expand;
359: lp+2fB s
360: a l.
361: THE DISPLAY
362: .sp 0.25
363: Text Area T{
364: .na
365: .ll 2.8i
366: A view onto a text buffer.
367: .br
368: Each window has its own text area.
369: Your display always has at least
370: one text area on it.
371: T}
372: .sp 0.25
373: Mode Line T{
374: .na
375: .ll 2.8i
376: Status line displayed at the bottom of a window.
377: .br
378: The mode line
379: displays the current buffer name, major and minor
380: editing modes, and current location in the file.
381: The variable \fImode-line-format\fP defines the contents
382: and layout of the mode line.
383: T}
384: .sp 0.25
385: Echo Area T{
386: .na
387: .ll 2.8i
388: A one-line area at the bottom of the screen.
389: .br
390: Error messages and progress messages are displayed
391: in the echo area.
392: This area is also called the \fImini-buffer\fP,
393: because Emacs command prompts and your responses are typed there.
394: .ad
395: T}
396: .TE
397: .sp 1
398: .TS
399: expand;
400: lp+2fB s
401: a l
402: l s
403: a l.
404: QUERY REPLACE
405: .sp 0.25
406: ESC % Invoke interactive replacement
407: .sp 0.5
408: T{
409: .na
410: .in +2n
411: .ll 3.5i
412: Query-replace will prompt you for a string
413: and another string with which to replace it.
414: Replacement proceeds from the current location (point)
415: to the end of the buffer.
416: The following query responses are recognized.
417: .in -2n
418: .ad
419: T}
420: .sp 0.5
421: space replace this match
422: DEL skip to next match
423: ESC exit query replace
424: \ . replace this match and exit
425: C-r enter recursive edit
426: C-w delete match and recursive edit
427: \ ! replace all remaining matches
428: \ ^ move back to previous match
429: .TE
430: .sp 1
431: .TS
432: expand;
433: lp+2fB l
434: l s.
435: WRITING NEW COMMANDS
436: .sp 0.25
437: T{
438: .na
439: .in +2n
440: .ll 3.5i
441: New commands can be written by performing them
442: as keyboard macros, then saving the keyboard macros
443: in a file as Emacs Lisp code. You may also write Emacs Lisp
444: code directly (using \fIemacs-lisp\fR mode).
445: The functions below are useful for writing and saving your own
446: new commands. They are invoked with\ \ ESC x \fIcommand\fP.
447: See also ``Macros and Repetition''.
448: .in -2n
449: .ad
450: T}
451: .TE
452: .sp 0.5
453: .TS
454: expand;
455: a r.
456: append-kbd-macro macro to Emacs Lisp file
457: end-kbd-macro finish macro definition
458: kbd-macro-query wait for user response in a macro
459: name-last-kbd-macro give defined macro a name
460: start-kbd-macro begin macro definition
461: write-kbd-macro write named macro to Emacs Lisp file
462: .TE
463: .sp 1
464: .TS
465: expand;
466: lp+2fB s
467: l s
468: a r.
469: REDEFINING COMMAND KEYS
470: .sp 0.25
471: T{
472: .in +2n
473: .ll 3.5i
474: Command keys may be redefined globally, or
475: just for the current major mode.
476: The following
477: functions are useful for redefining command
478: keys.
479: These commands may be invoked with ESC x \fIcommand\fP.
480: T}
481: .sp 0.5
482: describe-key tell what a key does
483: global-set-key define \fIkey\fP to execute \fIfunction\fP
484: global-unset-key remove default binding of \fIkey\fP
485: local-set-key define \fIkey\fP as \fIfunction\fP in this major mode
486: local-unset-key undefine \fIkey\fP in this major mode
487: .TE
488: .bp
489: .\" side 2 column 1
490: .ne 0.2i
491: .LG
492: .LG
493: .B
494: .ce
495: GNU Emacs Command Reference
496: .sp 0.5
497: .I
498: .SM
499: .ce
500: (version 17)
501: .R
502: .SM
503: .sp 1.25
504: .TS
505: expand;
506: lp+2fB s
507: a l.
508: CONTROL SEQUENCES
509: .sp 0.25
510: C-\fIx\fR control char
511: hold CTRL and type \fIx\fR
512: .sp 0.25
513: ESC \fIx\fR meta char
514: type ESC then type \fIx\fR
515: .sp 0.25
516: ESC C-\fIx\fR control-meta char
517: type ESC, then type C-\fIx\fR
518: .sp 0.25
519: C-x \fIx\fR ctrl-x char
520: type C-x then type \fIx\fR.
521: .T&
522: lp+2fB s
523: a l.
524: .sp 1
525: SIMPLE MOTION
526: .sp 0.25
527: C-a beginning-of-line
528: C-b backward-char
529: C-e end-of-line
530: C-f forward-char
531: TAB indent-for-tab-command
532: LINEFEED newline-and-indent
533: RETURN newline
534: C-n next-line
535: C-o open-line
536: C-p previous-line
537: DEL delete-backward-char
538: ESC < beginning-of-buffer
539: ESC > end-of-buffer
540: .T&
541: lp+2fB s
542: a l.
543: .sp 1
544: SCROLLING
545: .sp 0.25
546: C-v scroll-up
547: C-x < scroll-left
548: C-x > scroll-right
549: ESC C-v scroll-other-window
550: ESC v scroll-down
551: .T&
552: lp+2fB s
553: a l.
554: .sp 1
555: TEXT MOTION
556: .sp 0.25
557: C-x [ backward-page
558: C-x ] forward-page
559: ESC [ backward-paragraph
560: ESC ] forward-paragraph
561: ESC a backward-sentence
562: ESC b backward-word
563: ESC e forward-sentence
564: ESC f forward-word
565: .T&
566: lp+2fB s
567: a l.
568: .sp 1
569: TRANSPOSITION
570: .sp 0.25
571: C-t transpose-chars
572: C-x C-t transpose-lines
573: ESC C-t transpose-sexps
574: ESC t transpose-words
575: .T&
576: lp+2fB s
577: a l.
578: .sp 1
579: QUERIES AND FIXES
580: .sp 0.25
581: C-g quit immediately
582: C-l recenter (and fix screen)
583: \*(HC help-command
584: C-q quoted-insert
585: C-x = what-cursor-position
586: C-x l count-lines-page
587: C-x u advertised-undo
588: C-] abort-recursive-edit
589: ESC = count-lines-region
590: .\" side 2 column 2
591: .TE
592: .bp
593: .TS
594: expand;
595: lp+2fB s
596: a l.
597: .sp 1
598: DELETES, KILLS, AND YANKS
599: .sp 0.25
600: C-d delete-char
601: C-k kill-line
602: C-w kill-region
603: C-y yank
604: DEL delete-backward-char
605: C-x C-o delete-blank-lines
606: C-x DEL backward-kill-sentence
607: ESC C-w append-next-kill
608: ESC \e delete-horizontal-space
609: ESC ^ delete-indentation
610: ESC d kill-word
611: ESC k kill-sentence
612: ESC w copy-region-as-kill
613: ESC y yank-pop
614: ESC z zap-to-char
615: ESC DEL backward-kill-word
616: .T&
617: lp+2fB s
618: a l.
619: .sp 1
620: BUFFERS
621: .sp 0.25
622: C-x C-b list-buffers
623: C-x C-f find-file
624: C-x C-s save-buffer
625: C-x a append-to-buffer
626: C-x b switch-to-buffer
627: C-x h mark-whole-buffer
628: C-x k kill-buffer
629: C-x n narrow-to-region
630: C-x s save-some-buffers
631: C-x w widen
632: C-x 4 b switch-to-buffer-other-window
633: ESC ~ not-modified
634: .T&
635: lp+2fB s
636: a l.
637: .sp 1
638: WINDOWS
639: .sp 0.25
640: C-x 0 delete-window
641: C-x 1 delete-other-windows
642: C-x 2 split-window-vertically
643: C-x 5 split-window-horizontally
644: C-x ^ enlarge-window
645: C-x o other-window
646: ESC C-v scroll-other-window
647: C-x 4 C-f find-file-other-window
648: .T&
649: lp+2fB s
650: a l.
651: .sp 1e
652: FILES
653: .sp 0.25
654: C-x C-f find-file
655: C-x C-r find-file-read-only
656: C-x C-v find-alternate-file
657: C-x C-w write-file
658: C-x i insert-file
659: .T&
660: lp+2fB s
661: a l.
662: .sp 1
663: SEARCHING
664: .sp 0.25
665: C-s isearch-forward
666: C-r isearch-backward
667: ESC % query-replace
668: ESC C-s isearch-forward-regexp
669: .T&
670: lp+2fB s
671: a l.
672: .sp 1
673: LISP COMMANDS
674: .sp 0.25
675: ESC C-a beginning-of-defun
676: ESC C-b backward-sexp
677: ESC C-e end-of-defun
678: ESC C-f forward-sexp
679: ESC C-h mark-defun
680: ESC C-k kill-sexp
681: ESC ( insert-parentheses
682: ESC ) move-past-close-and-reindent
683: .TE
684: .bp
685: .TS
686: expand;
687: lp+2fB s
688: a l.
689: .sp 1
690: CASE CHANGES
691: .sp 0.25
692: C-x C-l downcase-region
693: C-x C-u upcase-region
694: ESC c capitalize-word
695: ESC l downcase-word
696: ESC u upcase-word
697: .T&
698: lp+2fB s
699: a l.
700: .sp 0.5
701: FILLING AND CENTERING
702: .sp 0.25
703: C-x f set-fill-column
704: C-x . set-fill-prefix
705: ESC q fill-paragraph
706: .T&
707: lp+2fB s
708: a l.
709: .sp 1
710: MARKS AND REGISTERS
711: .sp 0.25
712: C-@ set-mark-command
713: C-x C-p mark-page
714: C-x C-x exchange-point-and-mark
715: C-x / point-to-register
716: C-x g insert-register
717: C-x h mark-whole-buffer
718: C-x j register-to-point
719: C-x r copy-rectangle-to-register
720: C-x x copy-to-register
721: ESC C-@ mark-sexp
722: ESC C-h mark-defun
723: ESC @ mark-word
724: .T&
725: lp+2fB s
726: a l.
727: .sp 1
728: MACROS AND REPETITION
729: .sp 0.25
730: C-u universal-argument
731: C-x ( start-kbd-macro
732: C-x ) end-kbd-macro
733: C-x e call-last-kbd-macro
734: C-x q kbd-macro-query
735: ESC - negative-argument
736: ESC 0 .. ESC 9 digit-argument
737: .T&
738: lp+2fB s
739: a l.
740: .sp 1
741: FUNCTION INVOCATION
742: .sp 0.25
743: C-x C-e eval-last-sexp
744: C-x ESC repeat-complex-command
745: ESC ESC eval-expression
746: ESC x execute-extended-command
747: .T&
748: lp+2fB s
749: a l.
750: .sp 1
751: SHELLS AND SUBSYSTEMS
752: .sp 0.25
753: C-x d dired (edit directory)
754: C-x m mail
755: ESC ! shell-command
756: ESC | shell-command-on-region
757: ESC $ spell-word
758: .T&
759: lp+2fB s
760: a l.
761: .sp 1
762: EXIT
763: .sp 0.25
764: C-x C-c save-buffers-kill-emacs
765: C-x C-z suspend-emacs
766: ESC C-c exit-recursive-edit
767: .TE
768: .sp 1
769: .TS
770: expand;
771: lp+2fB s
772: l s
773: a l.
774: Some Editing Modes
775: .sp 0.25
776: \ (invoke with ESC x \fImode-name\fR)
777: .sp 0.25
778: abbrev-mode auto-fill-mode
779: c-mode text-mode
780: fundamental-mode lisp-interaction-mode
781: lisp-mode nroff-mode
782: outline-mode overwrite-mode
783: picture-mode scheme-mode
784: .TE
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.