Skip to content

Instantly share code, notes, and snippets.

@sumskyi
Last active March 18, 2018 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sumskyi/6873741 to your computer and use it in GitHub Desktop.
Save sumskyi/6873741 to your computer and use it in GitHub Desktop.
Emacs cheatsheet

Keys

Key Description
C-s Super key (Ctrl-x)
M-w Meta key (Alt-w)

SML

Key Description
M-p Call recent command from history
C-d Finish sml process
C-c C-s Start new sml process

File

Key Description
C-x C-c Quit Emacs
C-g Cancel the current action
C-x C-f Open a file (whether or not it already exists)
C-x C-s Save a file
C-x C-w Write a file (probably more familiar to you as Save as...)

Etc

Key Description
M-/ Autocompletion

Cut, copy, paste

Highlight text with the mouse or by hitting C-Space to set a mark and then moving the cursor to highlight a region.

Key Description
C-w Cut a highlighted region
M-w Copy a highlighted region
C-k Cut (kill) from the cursor to the end of the line
C-y Paste (yank)

Windows & Buffers

Key Description
C-x 2 Split the window into 2 buffers, one above the other
(Use the mouse or C-x o to switch between them)
C-x 0 Undo window-splitting so there is only 1 buffer
C-x b Switch to another buffer by entering its name
C-x C-b See a list of all current buffers
C-x o Focus on next window

Getting help within Emacs

In addition to the help button/menu on the right...

Key Description
C-h Hitting this will display a short message in the minibuffer:
C-h (Type ? for further options).
C-h b Key bindings. This lists all key bindings that are valid for the current mode.
Note that key bindings change from mode to mode.
C-h a Command apropos.
After typing C-h a you can type a symbol and a buffer
will appear that lists all symbols and functions that match that phrase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment