100% found this document useful (1 vote)
64 views

Emacs Cheat Sheet General and File Commands

This document provides a cheat sheet of common commands for Emacs, organized into categories such as general file commands, search, kill and yank, help commands, navigation, multiple buffer commands, rectangle commands, formatting and Python mode commands. It lists keyboard shortcuts for opening, saving, searching, replacing text, moving around buffers and files, splitting screens, formatting code, and using Python mode and shell features in Emacs. The cheat sheet is intended to help users learn essential Emacs commands and functions.

Uploaded by

Jeff Pratt
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
64 views

Emacs Cheat Sheet General and File Commands

This document provides a cheat sheet of common commands for Emacs, organized into categories such as general file commands, search, kill and yank, help commands, navigation, multiple buffer commands, rectangle commands, formatting and Python mode commands. It lists keyboard shortcuts for opening, saving, searching, replacing text, moving around buffers and files, splitting screens, formatting code, and using Python mode and shell features in Emacs. The cheat sheet is intended to help users learn essential Emacs commands and functions.

Uploaded by

Jeff Pratt
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Emacs Cheat Sheet

General and File Commands

C-x C-c Exit Emacs


C-_ (C-g) Undo – you can also use C-x u (Cancel command)
C-x C-f (C-x C-i) Open a file. (open file and paste in buffer)
C-x C-s (C-x C-w) Save buffer to file (Save as).
M-x revert-buffer Revert to the last saved version.
M-x print-buffer Send buffer to the printer

Search

C-s (C-r) Search forward (backwards)


M-% (M-x replace-string) Replace (Replace all)
M-g g Go to line number

Kill and Yank Commands

C-Space (C-x C-x) Set mark (Swap mark and cursor)


C-w (M-w) Kill region (copy)
C-d (M-d) (C-k) Delete character (Kill Word) (Kill Line)
C-y (M-y) Yank (cycle kill ring)

Help Commands

c-h ? (C-h m) (C-c ?) Help main menu (mode help) (current mode)
C-h i (C-h a) (C-h b) Info manuals (Command help) (key binding help)
C-M-v Scroll the help window

Navigation Commands

C-f (C-b) Forward (backward) one character


M-f (M-b) Forward (backward) one word
C-n (C-p) Next (previous) line
C-a (C-e) Beginning (end) of line
C-v (M-v) Page down (up)
M-< (M-<) Beginning (end) of buffer
C-l Redraw screen (centres on current line)

Multiple Buffer Commands

C-x b <buffer name> (C-x k) Switch to named buffer (Close current buffer)
C-x 2 (C-x 5) Horizontal split (vertical)
C-x 1 (C-x 0) Only show this buffer (Hide this buffer)

Rectangle Commands

C-x r k (C-x r y) Kill rectangle (Yank rectangle)


C-x r d (C-x r c) Delete rectangle (clear)
C-x r t (C-x r o) replace rectangle with string (space)

Formatting and Python Mode

M-/ auto-complete
M-q (C-M-\) format text to paragraphs (reindent code)
C-c C-c (C-c C-w Executes the current Python buffer (Runs pychecker).
C-c ! (M-x shell) Brings up the Python Shell (bash shell).

C-g means CTRL and the g key. M-x means ALT and the x key.
If you do not have an ALT key then use ESC then key. Do not type the brackets.
Get the latest copy from http://files.zeth.net/emacs.pdf

You might also like