Skip to content

Instantly share code, notes, and snippets.

@lisanhu
Created June 3, 2019 20:12
Show Gist options
  • Save lisanhu/1eb04ca0dfff1e903ae6fb847edcb88f to your computer and use it in GitHub Desktop.
Save lisanhu/1eb04ca0dfff1e903ae6fb847edcb88f to your computer and use it in GitHub Desktop.
Emacs Tutorial Cheat Sheet
# Moving short-cuts
C-v next page
M-v previous page
C-l make cursor middle
Number means how many lines above this line
C-n next line
C-p previous line
C-f one character forward
C-b one character backward
M-f one word forward
M-b one word backward
C-a Begin of a line
C-e End of a line
M-a Begin of a sentence
M-e End of a sentence
M-< Begin of the text
M-> End of the text
# Repeating
C-u NUM
M-NUM
C-v & M-v with Repeating will do on lines instead of screens
# Stopping
C-g stop any executing command, discard wrongly typed short cuts
# Windows
C-x 1 One window
# Deletion
<DelBack>
C-d same with <Delete>
M-<DelBack> kill word
M-d kill word afterwards
C-k kill to end of line
Repeating will result in killing the number of rows
M-k kill to end of sentence
# Mark
C-<SPC> Start marking
C-w kill marked
# Yank
C-y yanking
M-y replacing current yanking to previous buffers
# Undo
C-x u
# File
C-x C-f file name Find a file
C-x C-s Save file
# Buffer
C-x C-b Show list of buffers
C-x s Save some buffers
# Extending the Command set
C-x Character extend. Followed by one character.
M-x Named command extend. Followed by a long name.
C-x C-c Exit Emacs asking for modified buffers.
# Auto Save
M-x recover file recover to the auto-saved data
# Mode
M-x text-mode for example
C-h m document for current major mode
# Search
C-s Search forward
C-r Search backward
# Multiple Windows
C-x o change to other buffer
M-C-v scroll in the other window
# Recursive Editing Levels
ESC-ESC-ESC All-purpose get out
# More Help
C-h ? really lost
C-h C-g cancel
C-h c COMMAND-CHRARCTER-OR-SEQUENCE show command name being called
C-h c C-p
C-h k COMMAND show more detailed info about the command
C-h f function name explain a function
C-h v variable name Show doc for variables that could change the behaviour of Emacs
C-h a Command Apropos. Type in a keyword, Emacs will list all commands containing the keyword
C-h i Online document
# More features
Completion
Dired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment