Skip to content

Instantly share code, notes, and snippets.

@agarman
Last active September 15, 2017 09:10
Show Gist options
  • Save agarman/b98cbd947219187f8fc59c32ab1bdc38 to your computer and use it in GitHub Desktop.
Save agarman/b98cbd947219187f8fc59c32ab1bdc38 to your computer and use it in GitHub Desktop.
A cheat sheet for org-mode (gist incorrectly renders as markdown, view/print raw)

Headlines

Visibility cycling

TAB
Cycle subtree folded -> children -> subtree
S-TAB, C-u TAB
Cycle buffer
C-u C-u C-u TAB
Expand all
#+STARTUP: `overview`|`content`|`showall`
Startup options

Motion

C-c C-n
Next heading
C-C C-p
Previous heading
C-c C-f
Next heading, same level
C-c C-b
Previous heading, same level
C-c C-u
Up to parent

Structural editing

M-RET
Insert heading
M-S-RET
Insert TODO heading
TAB
Cycles through heading depths (when empty entry)
M-left/right
Increase/decrease heading depth
M-S-left/right
Increase/decrease subtree depth
M-S-up/down
Move subtree up/down
C-c C-c
Add tag to heading

Change view

C-x n s
Narrow buffer to subtree
C-x n w
Widen narrowed buffer
C-c /
Create a sparse tree view
C-c / r
Regex base sparse tree view

Plain lists

M-RET
Insert item
M-S-RET
Insert checkbox item
TAB
Cycle through list depths
C-c -
Cycle through list types
M-left/right
Increase/decrease item depth
M-S-left/right
Increase/decrease sub-list depth
M-S-up/down
Move sublist up/down
C-c C-c
Check checkbox item

Managing footnotes

C-c C-x f
Insert/follow footnote
C-c C-c
Jump to definition/reference

Tables

C-c |
Create table

Motion

TAB
Next field
S-TAB
Previous field
C-c C-c
Re-align
RET
Next row

Column & row editing

M-left/right
Move column left/right
M-S-left
Delete current column
M-S-right
Insert empty column
M-up/down
Move row up/down
M-S-up
Delete current row or horizontal line
M-S-down
Insert empty row
C-c -
Insert horizontal line below current row
C-c RET
Insert horizontal line & row
C-c ^
Sort table

Hyperlinks

C-c C-l
Edit/insert link
C-c l
Store link to current location
C-c C-o
Open link; customize-variable org-file-apps

Task lists

M-S-RET
Insert task item
C-c C-t
Toggle TODO/DONE
C-c / t
View task items in sparse tree
C-c a t
Global task list; from all agendas
C-c ,
Set priority
S-up/down
Increase/decrease priority
S-right/left
???
[/]
Track subtask progress as completed/total
[%]
Track subtask progress as percentage

Tags

C-c C-q
Add tag to headline
C-c / m
Create a sparse tree matching a tags search
C-c a m
Create a global list of tag matches from all agendas
C-c a M
Create a global list of TODO items that match tag

Properties

C-c C-x p
Set a property
C-c C-c d
Remove a property; when cursor in properties

Dates & Times

Timestamps

C-c .
Create a date <2016-05-27 Fri> & agenda entry
C-c !
Create a date [2016-05-27 Fri] w/o agenda entry
S-right/left
Change date by a day
S-up/down
Change date element under cursor

Deadlines & Scheduling

C-c C-d
Insert DEADLINE
C-c C-s
Insert SCHEDULED

Clocking work time

C-c C-x C-i
Clock-in
C-c C-x C-o
Clock-out
C-c C-x C-e
Update effort estimate for current clock task
C-c C-x C-q
Cancel current clock
C-c C-x C-j
Jump to entry with current running clock
C-c C-x C-r
Create time clock

Capture - Refile - Archive

Capture

C-c c
Start capture
C-c C-c
Complete capture
C-c C-w
Finalize by moving entry to a refile location
C-c C-k
Abort capture

Refile and copy

C-c M-x
Copy entry
C-c C-w
Refile entry
C-u C-c C-w
Use refile interface to jump to a heading
C-u C-u C-c C-w
Jump to location refile last moved a tree to

Archive

C-c C-x C-a
Archive current entry
C-c $
Arche subtree to org-archive-location
#+ARCHIVE: `file-template`
Specify archive location for current file

Agenda Views

Agenda files

C-c [
Add current file to list of agenda files
C-c ]
Remove current file from list of agenda files
C-,
Cycle through agenda file list

Agenda dispatcher

C-c a
Interactive agenda view
t
View of TODOs
T
Global view of TODOs
m
View of headlines with matching tag
M
Global view of headlines with matching tag
L
Timeline view of current buffer

Markup

#+TITLE: `title here`
Adds title to document
#+OPTIONS: `opt`
Add an option for export. Can be used multiple times

Blocks

#+BEGIN_VERSE … #+END_VERSE
Quote, including whitespace
#+BEGIN_QUOTE … #+END_QUOTE
Quote
#+BEGIN_CENTER … #+END_CENTER
Center block
#+BEGIN_COMMENT … #+END_COMMENT
Comment section, won’t be exported
C-c ;
Toggle COMMENT on entry
#+BEGIN_EXAMPLE … #+END_EXAMPLE
Example block
#+BEGIN_SRC `lang` … #+END_SRC
`lang` Source block
#+BEGIN_HTML … #+END_HTML
HTML block

Text formatting

*bold*
Text between asterisks is bold
/italic/
Text between slashes is italicized
_underlined_
Text between underbars is underlined
+strike-through+
Text between pluses is striked-through
=code=
Text between equals is code
~verbatim~
Text between tildes is verbatim

Items (e.g., images, tables, links and includes)

#+CAPTION: `caption here`
Add caption to next item
#+NAME: `name`
Name next item
#+INCLUDE: `file` [`example`|`src` `lang`]
Embed file on export

Exporting

C-c C-e #
Add options for export
C-c C-e t U
UTF-8 export to temporary buffer
C-c C-e h h
HTML export to `current-file-name.html`
C-c C-e h o
HTML export, open in browser
C-c C-e l p
PDF export to `current-file-name.pdf`
C-c C-e l o
PDF export, open in PDF viewer

Babel

#+BEGIN_SRC `lang` `switches` `header args`
Begin of a babel block
  • Header arguments
    :var
    Variables being passed to code block
    :results
    Controls handling of code block’s results
    vector, scalar, file, raw, html, latex
    Processing of result
    silent, replace, prepend, append
    If and how to add to buffer
    :session
    Enable persistent evaluation between code blocks
    :exports `code`|`results`|`both`|`none`
    What to export
    :tangle `no`|`yes`|`filename`
    Specify tangle file for export
    C-c C-v t
    Tangle current org-mode buffer
    :cache `yes`|`no`
    `yes` only reruns if inputs change
    :file `filename`
    File used by blocks that produce files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment