0% found this document useful (0 votes)
304 views3 pages

Emacs Cheat Sheet

This document is an Emacs cheat sheet that provides shortcuts for common commands like undo (C-_), saving files (C-x C-s), and exiting Emacs (C-x C-c). It also includes shortcuts for cursor motion, cutting/pasting, scrolling windows, searching/replacing text, and getting help. The cheat sheet recommends additional resources for learning Emacs like Dave Cohen's original sheet and the GNU Emacs FAQ accessed within Emacs.

Uploaded by

Andrew Hautau
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)
304 views3 pages

Emacs Cheat Sheet

This document is an Emacs cheat sheet that provides shortcuts for common commands like undo (C-_), saving files (C-x C-s), and exiting Emacs (C-x C-c). It also includes shortcuts for cursor motion, cutting/pasting, scrolling windows, searching/replacing text, and getting help. The cheat sheet recommends additional resources for learning Emacs like Dave Cohen's original sheet and the GNU Emacs FAQ accessed within Emacs.

Uploaded by

Andrew Hautau
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/ 3

emacs cheat sheet

http://www.rgrjr.com/emacs/emacs_cheat.html

Emacs Cheat Sheet


(original version by David Cohen) (revised by Bob Rogers)
Home

: Emacs tips : Cheat sheet

UNDO: C-_ ("control underscore") Find (or Create) le: C-x C-f Save le: C-x C-s Exit Emacs: C-x C-c Quit (i.e. interrupt) command: C-g Cursor Motion
Amount Characters Words Lines Sentences Expressions Paragraphs End/start of line End/start of buffer Operation

Cutting and Pasting

Move Delete C-SPC Mark one end of region forward backward forward backward C-w Cut (after you Mark and move to other end) C-f C-b C-d DEL M-w Copy (after you Mark and M-f M-b M-d M-DEL move to other end) C-k (to C-SPC C-a C-y Yank (paste) most recently C-n C-p C-w EOL) killed (cut or copied); will M-a M-e M-k C-x DEL also use text currently selected in another C-M-f C-M-b C-M-k C-M-DEL application. (no standard M-y Next most recently killed M-} M-{ bindings for delete (do C-y rst, repeat M-y to cmds) cycle thru all) (repeat count goes To make cut/copy/paste behave C-e C-a to following lines) as it does in Macintosh and Windows apps, do M-< M-> (no repeat count) M-x pc-selection-mode, or put
(pc-selection-mode)

in your .emacs le to enable this in every session.

Scrolling and Windows


C-v M-v C-M-v C-x 1 C-x 2 C-x 3

Files and Buffers


C-x C-f

Scroll down (toward end of buffer) Scroll up (toward beginning of buffer) Scroll other window down One window on current buffer Split window vertically Split window horizontally

C-x C-s C-x C-w

Find le (or create if not there); prompts for le name Save le Write le; prompts for new name

1 of 3

10/2/11 9:01 PM

emacs cheat sheet

http://www.rgrjr.com/emacs/emacs_cheat.html

C-x ^

Grow window vertically; prex is number of lines

C-x s

Command-related Stuff
ESC ESC ESC C-u # C-g

Get me out of where I am now Prex numeric arg # (digits with optional "-" sign) to next cmd Stop a command in progress, or quit out of a partially entered command

C-x b

C-x C-b

Save modied buffers; asks about each Select buffer; prompts for buffer name List buffers; shows in other window

Searching/Replacing
C-s

C-h k C-h a C-h c C-h f

C-h i

Incremental search forward; searches as Show command documentation; prompts for you type keystrokes C-r Incremental search "Command apropos"; prompts for regexp and backward shows all matching commands M-x String replace from Show command name on message line; replacehere to end of buffer; string RET prompts for keystrokes prompts for string Describe function; prompts for command or and replacement function name, shows documentation in other M-x query- String replace from window replace here to end of buffer, RET Info browser; gives access to online querying for each documentation for emacs and more occurrence

Getting help

Miscellaneous
or C-x u Undo/redo (a series of these keeps undoing; after doing something else, C-_ or C-x u will undo the undo's) C-q Quoted insert; inserts the next character typed, even if it is a control or meta character M-x shellFlush ^M at end of line
C-_ strip-ctrl-m RET C-z C-x C-c

Suspend/iconify emacs (type "%emacs" in invoking shell to get it back) Exit emacs (asks about unsaved buffers and running programs)

Other resources for learning emacs


[This is from the Emacs tips page.] Dave Cohen's original emacs cheat sheet at http://www.primenet.com/~cohen /emacs_cheat.html (dead link), written by an alumnus of the August bootcamp. Tutorial outline for the tutorial presented at bootcamp on 4-Oct-99. emacsis.great tutorial page (not hypertext), with a topical command summary at the bottom. This is very dense, and covers a lot of ground.
2 of 3 10/2/11 9:01 PM

emacs cheat sheet

http://www.rgrjr.com/emacs/emacs_cheat.html

GNU emacs FAQ. This is also available in emacs itself by typing "C-h F" (note that the "F" must be capitalized). The Web version is hypertext, though it isn't very easy to navigate, and it does have a reference page that points to all kinds of good stuff. The version within emacs is not hypertext, but it's all on one page, and you can use C-s (incremental search) to nd things of interest. Bob Rogers <[email protected]> $Id: emacs_cheat.html 288 2011-06-25 22:36:01Z rogers $

3 of 3

10/2/11 9:01 PM

You might also like