Skip to content

Instantly share code, notes, and snippets.

@BonfaceKilz
Last active January 15, 2017 20:27
Show Gist options
  • Save BonfaceKilz/cc489c5e2537f880d6f8a6a3b6c0257d to your computer and use it in GitHub Desktop.
Save BonfaceKilz/cc489c5e2537f880d6f8a6a3b6c0257d to your computer and use it in GitHub Desktop.
Emacs cheatsheet

Macro: How to record and play

  1. Start recording a macro by pressing #C-X (#

High Level Steps to Record and Play inside Emacs

  1. C-x ( : Start recording a macro
  2. C-x ) : Stop recording a macro
  3. C-x e : Play last recorded macro

Naming and Saving macros, and playing later

  1. C-x C-k n : naming a macro
  2. M-x <macro-name> : run the named

General Stuff

  1. C-j: Add new line below the one you are in
  2. C-r: Backward search
  3. C-s: Forward search
  4. M-/: Complete Word at cursor
  5. M-w: Copy selected text into clipboard
  6. C-d: Delete character forward
  7. M-d: Delete word forward
  8. C-k: Delete line
  9. C-x C-k: Delete marked region
  10. C-M-\: Indent Region
  11. C-u M-u: Join from above with below
  12. M-^: Join up from the line where you are

Windows/ Buffers/ Frames

  1. C-x 1: One Window(i.e. Kill all other windows)
  2. C-x C-b: List all buffers
  3. C-M-v/ C-M-S-v: Scroll the bottom window
  4. C-x 4 C-f: Finding a file in another window independently
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment