0% found this document useful (0 votes)
73 views2 pages

Emacs23 Survival

GNU Emacs survival card for version 23. Emacs divides the frame into several areas: menu line, buffer area with edited text, mode line describing the buffer in the last line. To create a tags table file, type 'etags input files' as a shell command.

Uploaded by

locantore
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views2 pages

Emacs23 Survival

GNU Emacs survival card for version 23. Emacs divides the frame into several areas: menu line, buffer area with edited text, mode line describing the buffer in the last line. To create a tags table file, type 'etags input files' as a shell command.

Uploaded by

locantore
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

GNU Emacs Survival Card

for version 23

Searching
C-s C-r RET M-C-s M-C-r search for a string search for a string backwards quit searching regular expression search reverse regular expression search

In the following, C-z means hit the z key while holding down the Ctrl key. M-z means hit the z key while hitting the Meta (labeled Alt on some keyboards) or after hitting Esc key.

Use C-s or C-r again to repeat the search in either direction.

Running Emacs
To enter GNU Emacs, just type its name: emacs. Emacs divides the frame into several areas: menu line, buer area with the edited text, mode line describing the buer in the window above it, and a minibuer/echo area in the last line. C-x C-c C-x C-f quit Emacs edit le; this command uses the minibuer to read the le name; use this to create new les by entering the name of the new le save the le kill a buer in most context: cancel, stop, abort partially typed or executing command undo

Tags
Tags tables les record locations of function and procedure denitions, global variables, data types and anything else convenient. To create a tags table le, type etags input les as a shell command. M-. nd a denition C-u M-. nd next occurrence of denition M-* pop back to where M-. was last invoked M-x tags-query-replace run query-replace on all les recorded in tags table M-, continue last tags search or query-replace

C-x C-s C-x k C-g C-x u

Compiling
M-x compile C-c C-c C-x compile code in active window go to the next compiler error, when in the compile window or when in the window with source code

Moving About
C-l C-x b M-< M-> M-g M-g scroll current line to center of window switch to another buer move to beginning of buer move to end of buer go to a given line number

Dired, the Directory Editor


C-x d d ~ u x C g f s invoke Dired ag this le for deletion ag all backup les for deletion remove deletion ag delete the les agged for deletion copy le update the Dired buer visit the le described on the current line switch between alphabetical date/time order

Multiple Windows
C-x C-x C-x C-x C-x 0 1 2 3 o remove the current window from the display make active window the only window split window horizontally split window vertically move to other window

Regions
Emacs denes a region as the space between the mark and the point. A mark is set with C-space. The point is at the cursor position. M-h C-x h mark entire paragraph mark entire buer

Reading and Sending Mail


M-x q h d x C-x C-c C-c rmail start reading mail quit reading mail show headers mark the current message for deletion remove all messages marked for deletion begin composing a message send the message and switch to another buer move to the CC header eld, creating one if there is none

Killing and Copying


C-w M-w C-k M-DEL C-y M-y kill region copy region to kill-ring kill from the cursor all the way to the end of the line kill word yank back the last kill (C-w C-y combination could be used to move text around) replace last yank with previous kill

m C-c C-f C-c

Miscellaneous
ll paragraph expand previous word dynamically iconify (suspend) Emacs when running it under X or shell, respectively M-x revert-buffer replace the text being edited with the text of the le on disk M-q M-/ C-z

Query Replace
M-% M-C-% SPC , DEL ! ^ RET C-r interactively search and replace using regular expressions replace this one, go on to next replace this one, dont move skip to next without replacing replace all remaining matches back up to the previous match exit query-replace enter recursive edit (M-C-c to exit)

Spelling Check
M-$ check spelling of word at the cursor M-x ispell-region check spelling of all words in region M-x ispell-buffer check spelling of entire buer

Valid responses in query-replace mode are

International Character Sets


C-x RET C-\ C-\ M-x M-x C-x M-x M-x M-x select and activate input method for the current buer enable or disable input method list-input-methods show all input methods set-language-environment specify principal language RET c set coding system for next command find-file-literally visit le with no conversion of any kind list-coding-systems show all coding systems prefer-coding-system choose preferred coding system

Regular Expressions
. (dot) * + ? [. . .] [^. . .] \c . . .\|. . .\|. . . \( . . . \) \n ^ $ \w \W \< \> \b \B any single character except a newline zero or more repeats one or more repeats zero or one repeat denotes a class of character to match negates the class quote characters otherwise having a special meaning in regular expressions matches one of the alternatives (or) groups a series of pattern elements to a single element same text as nth group matches at line beginning matches at line end matches word-syntax character matches non-word-syntax character matches at word beginning matches at word end matches at word break matches at non-word break

Keyboard Macros
C-x C-x C-x C-u M-x ( start dening a keyboard macro ) end keyboard macro denition e execute last-dened keyboard macro C-x ( append to last keyboard macro name-last-kbd-macro name last keyboard macro

Simple Customization
M-x customize customize variables and faces

Getting Help
Emacs does command completion for you. Typing M-x tab or space gives a list of Emacs commands. C-h C-h C-h C-h C-h t i a k Emacs help run the Emacs tutorial enter Info, the documentation browser show commands matching a string (apropos) display documentation of the function invoked by keystroke

Registers
C-x C-x C-x C-x r r r r s i SPC j save region in register insert register contents into buer save value of point in register jump to point saved in register

Emacs gets into dierent modes, each of which customizes Emacs for editing text of a particular sort. The mode line contains names of the current modes, in parentheses. C-h m get mode-specic information

Rectangles
C-x C-x C-x C-x C-x C-x r r r r r r r k y t o c copy rectangle to register kill rectangle yank rectangle prex each line with a string open rectangle, shifting text right blank out rectangle

Shells
M-x shell M-! M-| C-u M-| start a shell within Emacs execute a shell command run a shell command on the region lter region through a shell command
Copyright c 2011 Free Software Foundation, Inc. For GNU Emacs version 23 Author Wlodek Bzyl (matwb@univ.gda.pl) Permission is granted to make and distribute copies of this card provided the copyright notice and this permission notice are preserved on all copies.

You might also like