Start a numbered list from any number using the syntax “N. [@N] ⋯”, a nice way to have 0-numbered lists or lists with text in between that does not reset the numbering.
- Emacs CheatSheet
- M-n 𝕏 / C-u n 𝕏
- Repeat command 𝕏
$n$ times.- n may be omitted in the second form, defaulting to 4.
- Whence, it may be stacked: “C-u ⋯ C-u 𝕏” repeats command 𝕏 4ⁿ-times where n is the number of C-u commands.
- Holding
Alt
key and press1
then2
then3
then release theAlt
key, and, say, press thej
key. Now you have 123 j’s inserted lol.
I have so many things installed, I’m forgetting some of the stuff that I installed to be more productive! Whence this “personal” cheat sheet. —I’m not trying to be comprehensive; see the existing cheatsheets for Emacs and Org.
There are already cheatsheets for Emacs, Org, and even Elisp; so why bother with another one? The general ones are great but contain stuff I rarely use, such as information on registers, but are missing stuff I’d like to know, such as Helm keybindings which are not shipped with Emacs.Below are the bindings that are shipped with Emacs or the packages one installs.
To be somewhat useful to others, my personal bindings will be “enclosed” in quotes.
I will write X,Y-x,y
to denote one of X
or Y
followed by one of x
or y
; e.g.,
C,M-d
denotes C-d
and M-d
–for character and word deletion, respectively.
Hopefully this makes it easier to group related commands.
As always, since I’ve installed which-key
, it suffices to press a prefix
then look at the resulting menu 😃
C-h C-h | Help for the help command |
C-h h | Learn how to say ‘hello’ |
C-h t | Read the Emacs tutorial |
C-h m | Help for current mode |
C-h b | Describe all key bindings |
C-h i m emacs | Read the Emacs manual |
In nearly every Emacs application, press
?, h
- Obtain help; see listing of possible commands.
q
- Quit current application, closing buffer.
Use Emacs in any text area on my OS with Cmd Shift e
.
{{{no-vertical-padding(2.5)}}}
C-h o | Describe symbol at point; best one. |
C-h k,f,m | Describe key press, function name, or mode |
C-h a | Apropos: Show commands matching a string |
C-h e | Open *Messages* buffer in another window |
C-h i | Enter Info documentation reader |
Info
:
h | Run Info ’s tutorial |
i | Lookup item using index |
m | Select menu item by name |
g | Go to any node, by name |
spc, del | Scroll down, up |
n, p | Next, previous topic node |
b | Beginning of node |
d | Return to main directory node |
{{{no-vertical-padding(2)}}}
C-x 0,1 | Delete this, other windows |
C-x 2,3 | Split window above, to the side |
C-x o | Switch cursour to other window |
C-x ^ | Increase window height |
C-x {,} | Shrink, widen window |
Using C-x 5 ...
in place of C-x ...
operates on the
‘frame’ level –i.e., other Emacs GUI instances.
C-x 4 ?
is for acting on the other window, where
? = f, d, b
for finding file, directory, buffer.
Perhaps most useful is C-x 4 c
for working with
different parts of the same buffer.
C-x 4 c clone-indirect-buffer-other-window. It splits the current window, clones the current buffer and visits the clone in the newly opened window.
C-x 2
splits and copies the current buffer, but it’s inappropriate for
looking at one part of the buffer while working on another part since
every editing change happens live, including superficial visual changes
such as region folding and narrowing.
Instead, we select the region we’re working on, for example,
then press C-x 4 c C-x n n
to clone the buffer then to narrow
the region we’re working on.
“s-<arrow>” | Jump to window via arrow key |
“M-<tab>” | Flip to next buffer |
“M-S-<tab>” | Flip to previous buffer |
All commands are prefixed by C-x x
; main commands:
s | Select a space to go to or create it. |
n,→, p,← | Next, previous space |
c | Query a perspective to kill. |
r | Rename a perspective. |
A | Add buffer to current perspective & remove it from all others. |
{{{no-vertical-padding(1.5)}}}
C-x u
Visualise undo tree.t, d
toggle timestamps and diff display.M-{,}
Go to previous, next branching point.q
Exit at currently selected state.
C-x r u
Save current buffer state.C-x r U
Restore saved buffer state.
Save & restore is useful for experimenting with a function definition, for example.
Undo Tree also has functions which save an undo state to a register and which restore a save state from a register. These are bound to C-x r u and C-x r U by default. These are great for things like experimenting with a function definition.{{{no-vertical-padding(2)}}}
C,M-d | forward kill character, word |
C,M-del | backward kill word prefix |
C-k , “M-k” | forward, backward kill line |
C-x del | backward kill sentence |
---|---|
C,M-w | Kill, copy region |
C-x r k | Kill region |
C-x C-o | Delete all but one consecutive blank lines |
M-y | Show kill ring, with “helm” |
{{{no-vertical-padding(2)}}}
C-SPC | Set mark |
C-x C-x | Exchange point & mark |
C-x h | Mark buffer |
[C-u 𝓃] M-@ | Mark a / 𝓃 words away |
M-h | Mark current paragraph |
\columnbreak
{{{no-vertical-padding(2)}}}
By default C-t
is transpose characters; I’m using it quickly open a terminal.
C-M-\ | Indent region, mode dependent |
C-x tab | Indent region arg columns or ←,→ |
M-; | Toggle comment region |
C-c ; | Org toggle comment subtree |
C-M-o | Move rest of line vertically down |
M-u,l | Upcase, downcase rest of word |
C-x C-u,l | Upcase, downcase region |
C-x r t | Prepend string to marked lines |
M-t | Transpose current word with next |
C-x C-t | Transpose current line with above |
{{{no-vertical-padding(1.5)}}}
M-$ | Spellcheck word |
“M-#” | Synonym for word |
“M-!” | Define word |
“M-^” | Grammar check region |
“C-c t” | Google translate region |
{{{no-vertical-padding(1)}}}
C-b, f | ←, → character |
M-b, f | ←, → word |
---|---|
C-p, n | ↑,↓ line |
M-g g | go to a line |
C-a, e | start, end line |
M-a, e | start, end sentence |
M-{, } | start, end paragraph |
M-<, > | start, end buffer |
C-v | down page |
M-v | up page |
C-l | centre page |
M-r | relocate point |
C-l
reorients the buffer so that the current line is at the
top/center/bottom of the screen. Whereas M-r
moves the point
to top/center/bottom without recentering the window.
Org-mode: All commands are prefixed by C-c
.
n,p | next, previous heading |
f,b | n,p same level heading |
C-u | backward to higher heading |
C-j | ↑↓ jump to another heading |
“C-h” | Fold current tree |
Using the “super key” to navigate between org blocks.
“s-p,n” | Previous, next src block |
“s-e” | Toggled editing src block |
C-x m | Compose |
C-c C-s | Send |
M-x gnus | Read mail |
Then,
RET | Open article |
B m | Move an article |
! | Mark as read, but it keep around |
d | Mark as read; archive it. |
R | Reply in-place. |
r | Reply in clean slate. |
Delete an article by moving it to ‘Trash’.
{{{no-vertical-padding(2)}}}
M-/ | Expand previous word dynamically |
M-<digit> | Select one of the 10 suggestions |
{{{no-vertical-padding(1)}}}
This allows us to “zoom in” or “focus” on a particular region;
the rest of the buffer is ‘hidden’. All commands begin with C-x n
.
n | Narrow to region |
w | Widen to full view |
e | Narrow to org element |
s | Org narrow current tree |
{{{no-vertical-padding(2)}}}
C-s | Search current buffer |
“C-M-s” | Search all buffers |
“C-S-s” | Back to where search began |
M-s M-w | Search region in Web |
C-c C-e
during a search to make live edits.
{{{no-vertical-padding(2)}}}
tab | Cycle visibility |
S-tab | Cycle global visibility |
C-c C-x C-v | Toggle inline image display |
C-c C-x C-l | Toggle, preview, LaTeX for tree |
{{{no-vertical-padding(3)}}}
<return> | Newline with indentation |
M-<return> | Newline with new org item |
M-S-<return> | Ditto, but with a TODO marker |
C-M-<return> | Newline, cursor at start |
C-<return> | New heading after current content |
C-S-<return> | Ditto, but with a TODO marker |
---|---|
C-c -,* | Demote, promote headings to items |
M-←,→ | Promote, demote heading |
C-c C-t | Set state of tree |
C-c , A,B,C | Set priority A, B, or C for tree |
C-c , Spc | Remove priority from tree |
C-c C-x p,e | Set property, effort of tree |
M-↑,↓ | Move any org element up or down |
M-S-↑,↓ | Move a line up or down |
C-c c | Capture new item |
C-c C-x C-a | Archive tree |
{{{no-vertical-padding(2)}}}
C-c C-c | Execute code block |
C-c C-v j | Insert header argument |
C-c C-v I | View, possibly global, header info |
C-c C-v g | Go to named block |
C-c C-v n,p | Go to next, previous block |
C-c C-v d | Demarcate, split up, code block |
C-c C-v t | Tangle all blocks in buffer |
M-x list-input-methods
show all input methods
C-c C-x i | Capture column view in dynamic block |
C-+ | Increase text size |
C-- | Decrease text size |
“C-x d” | Toggle Neotree file browser |
“C-c C-m” | Re-compile; execute local compile command |
“<f5>”, s-r | Reload buffer from disk |
“C-∣” | Swap 2 horizontal windows to vertical |
“C-t” | Quickly pop-up a terminal |
C-c C-o | Open link at point |
{{{no-vertical-padding(1)}}}
With cursor at the beginning of an org headline:
# | Toggle COMMENT -ing |
t | Select state |
s | Toggle narrowing |
I,O,E | Clock in, out; add effort |
p,n | Previous, next heading |
f,b | p,n for same-level |
u | Upward to parent |
c | Cycle visibility |
w | Refile, relocate |
^ | Sort children trees |
D,U | Move heading down, up |
L,R | Promote, demote |
1,2,3 | Select priority |
? | See possible keys |
{{{no-vertical-padding(2)}}}
C-c . | Prompt for date & insert timestamp |
C-c C-d | Insert deadline for tree |
C-c C-s | Schedule a tree |
S-↑,↓,→,← | Alter timestamp by a day →←, year ↓↑ |
C-c C-x C-t | Globally toggle date display |
{{{no-vertical-padding(2)}}}
C-c C-x C-i,o | Start, stop clock on tree |
C-c C-x C-r | Insert, update, clock report |
C-c C-x C-e | Insert effort for current clock |
{{{no-vertical-padding(2.5)}}}
C-c c | Capture an idea quickly |
C-c a | Open agenda to see tasks |
C-c j | Discuss what’s accomplished |
C-c C-z | Add note to current tree |
C-c C-s | Schedule a task |
C-c C-a | Archive a task |
C-c a a | See agenda for the week |
“C-c a c” | See completed tasks |
“C-c a u” | See unscheduled tasks |
C-c a t | Compile global todo list |
C-c C-x b | Open agenda task in dedicated indirect buffer |
F | Toggle follow mode: See details as you navigate |
v | Change agenda view, e.g., to day or month |
f / b | Forward, backward a view, e.g., day or month |
R | See report of total clocked time |
. / j | Go to today, or prompt for a date |
e, t, a | Remotely set effort, state, or archive |
I, O, X | Start, stop, cancel clock on current item |
C-c C-x C-r | See clocked times report |