docs/manual/guide/04-outlines.org

1025 lines · 56464 bytes

   1#+TITLE: Outlines and structure
   2#+DESCRIPTION: Headings, subtrees, plain lists, checkboxes, blocks, drawers, properties, column view, footnotes, refiling and archiving.
   3#+LEDE: An org file is an outline of headings with text, lists and drawers under them; this chapter covers the commands that build and rearrange it.
   4
   5Every command in this chapter is in the Org menu and the command palette (=⇧⌘P=),
   6under the title given in the tables, whatever keymap you use. The Org menu shows the
   7keys that run each command in your current keymap.
   8
   9Keys are listed for the three presets. The Emacs and Doom presets use Emacs notation
  10(=M-RET= is Meta-Return, =C-c C-w= is Control-c then Control-w). The Mac preset uses
  11macOS symbols. The Doom preset has every Emacs-preset key that starts with =C-c= or
  12=C-x=, and the =M-=, =S-= arrow and =RET= chords, in normal, insert and visual
  13state, plus the Doom keys listed. Where the Mac column says "menu", the Mac preset has
  14no key for the command; run it from the Org menu or the palette, or bind one in
  15=keymap.toml= (see [[file:03-keys.org][Keys]]).
  16
  17* Headings
  18
  19A heading is a line that starts with one or more stars and a space. The number of stars
  20is its level. A heading and everything under it, down to the next heading at the same
  21or a higher level, is a subtree.
  22
  23#+BEGIN_SRC org
  24,* Project
  25Notes about the project.
  26,** TODO Write the plan
  27,** Meetings
  28,*** Kickoff
  29#+END_SRC
  30
  31** Inserting headings
  32
  33| Command                      | Org command                              | Emacs     | Mac   | Doom      |
  34|------------------------------+------------------------------------------+-----------+-------+-----------|
  35| Insert Heading               | =org-insert-heading=                     | =M-RET=   | =⌘↩=  | =M-RET=   |
  36| Insert Heading After Subtree | =org-insert-heading-respect-content=     | =C-RET=   | =⌃⌘↩= | =C-RET=   |
  37| Insert TODO Heading          | =org-insert-todo-heading=                | =M-S-RET= | =⇧⌘↩= | =M-S-RET= |
  38
  39The new heading has the level of the heading the caret is under, or level 1 before the
  40first heading. In a plain list the same keys insert an item instead (see [[*Plain lists][Plain lists]]).
  41
  42Insert TODO Heading gives the new heading the keyword of the previous heading at the
  43same level when that keyword is not a done state, and otherwise the first keyword of
  44the file's TODO sequence. If the parent has a statistics cookie, it is updated.
  45
  46Two settings change where Insert Heading puts the heading. Both are in Settings ▸
  47Editing and in =config.toml= under the Emacs variable names:
  48
  49| Setting (=config.toml=)              | Settings ▸ Editing                            | orgstar default | Org default |
  50|--------------------------------------+-----------------------------------------------+-----------------+-------------|
  51| =org-insert-heading-respect-content= | M-RET adds the new heading after the subtree  | =true=          | =nil=       |
  52| =org-M-RET-may-split-line=           | M-RET splits the line at the caret            | =false=         | =t=         |
  53
  54With =org-insert-heading-respect-content= on (the orgstar default), Insert Heading
  55behaves as Insert Heading After Subtree: the new heading goes after the end of the
  56current subtree, at the current level. Insert Heading also does this when the caret is
  57in folded text.
  58
  59With it off, Insert Heading works where the caret is:
  60
  61- At the start of a heading line, the new heading is inserted above it.
  62- Elsewhere on a heading line, the new heading goes below that line. With
  63  =org-M-RET-may-split-line= on and the caret inside the title, the text after the caret
  64  moves to the new heading. Tags stay on the original line and are realigned.
  65- In body text, a new heading line is started below. With =org-M-RET-may-split-line=
  66  on, the line is split at the caret first.
  67
  68orgstar follows Org's =org-blank-before-new-entry= default of =auto= for headings: if
  69the heading the caret is in is preceded by a blank line, the new heading is too.
  70
  71Insert Heading After Subtree always inserts after the subtree:
  72
  73#+BEGIN_SRC org
  74,* a
  75body
  76,** b
  77,* c
  78#+END_SRC
  79
  80With the caret on =* a=, =C-RET= gives:
  81
  82#+BEGIN_SRC org
  83,* a
  84body
  85,** b
  86,*
  87,* c
  88#+END_SRC
  89
  90** Promoting and demoting
  91
  92| Command         | Org command          | Emacs         | Mac    | Doom                                      |
  93|-----------------+----------------------+---------------+--------+-------------------------------------------|
  94| Promote Heading | =org-promote=        | =M-<left>=    | =⌃⌘←=  | =M-h=; in insert state =S-TAB= or =C-d=   |
  95| Demote Heading  | =org-demote=         | =M-<right>=   | =⌃⌘→=  | =M-l=; in insert state =TAB= or =C-t=     |
  96| Promote Subtree | =org-promote-subtree= | =M-S-<left>=  | =⌃⌥⌘←= | =M-H=, =SPC m s h=                        |
  97| Demote Subtree  | =org-demote-subtree= | =M-S-<right>= | =⌃⌥⌘→= | =M-L=, =SPC m s l=                        |
  98
  99These run with the caret on a heading line. Promote and Demote Heading change only that
 100line's stars; its children keep their level. The subtree commands change the heading and
 101every heading under it. Tags are realigned after each change. A level 1 heading can't be
 102promoted ("Cannot promote to level 0").
 103
 104On a list item the same keys indent and outdent the item instead.
 105
 106** Moving subtrees
 107
 108| Command           | Org command              | Emacs      | Mac    | Doom              |
 109|-------------------+--------------------------+------------+--------+-------------------|
 110| Move Subtree Up   | =org-move-subtree-up=    | =M-<up>=   | =⌃⌥⌘↑= | =M-k=, =SPC m s k= |
 111| Move Subtree Down | =org-move-subtree-down=  | =M-<down>= | =⌃⌥⌘↓= | =M-j=, =SPC m s j= |
 112
 113The subtree at the caret swaps places with the previous or next sibling subtree. It
 114can't move past its parent or the start or end of the file. The caret keeps its column.
 115
 116On a list item the same keys move the item; in a table they move the row. On other
 117elements (paragraphs, blocks, drawers, keywords) they drag the element past the one
 118before or after it in the same section, drawer or greater block, as
 119=org-drag-element-backward= and =org-drag-element-forward= do. The blank lines between
 120the two stay where they were.
 121
 122** Moving between headings
 123
 124| Command                        | Org command                       | Emacs     | Mac    | Doom              |
 125|--------------------------------+-----------------------------------+-----------+--------+-------------------|
 126| Next Heading                   | =org-next-visible-heading=        | =C-c C-n= | =⌥⌘↓=  | =C-c C-n=         |
 127| Previous Heading               | =org-previous-visible-heading=    | =C-c C-p= | =⌥⌘↑=  | =C-c C-p=         |
 128| Next Heading at Same Level     | =org-forward-heading-same-level=  | =C-c C-f= | =⌥⇧⌘↓= | =] h=             |
 129| Previous Heading at Same Level | =org-backward-heading-same-level= | =C-c C-b= | =⌥⇧⌘↑= | =[ h=             |
 130| Up to Parent Heading           | =outline-up-heading=              | =C-c C-u= | menu   | =g h=             |
 131| Go to Heading…                 | =org-goto=                        | =C-c C-j= | menu   | =SPC m .=         |
 132
 133Next and Previous Heading skip headings that are folded out of sight. The same-level
 134commands stop at the parent's boundary. In Doom's normal state, =gj= and =gk= move by
 135Org element, as evil-org's =org-forward-element= and =org-backward-element=: on a
 136heading line, to the next heading after its subtree, or to the previous heading at the
 137same level or higher (see [[file:03-keys.org][Keys and commands]]). Go to Heading asks for a heading by its outline
 138path (=Project/Meetings/Kickoff=) with completion, as =org-goto= does with
 139=outline-path-completion=.
 140
 141** Toggling headings, items and comments
 142
 143| Command         | Org command                                | Emacs   | Mac  | Doom              |
 144|-----------------+--------------------------------------------+---------+------+-------------------|
 145| Toggle Heading  | =org-toggle-heading=                       | =C-c *= | menu | =SPC m h=         |
 146| Toggle Item     | =org-ctrl-c-minus=, =org-toggle-item=      | =C-c -= | menu | =SPC m i=         |
 147| Toggle COMMENT  | =org-toggle-comment=                       | =C-c ;= | menu | =C-c ;=           |
 148
 149These work on the caret's line, or on every line of the selection.
 150
 151Toggle Heading:
 152
 153- On headings, removes their stars, so they become text.
 154- On list items, turns them into headings one level below the entry they are in. A
 155  checkbox becomes a keyword: =[ ]= the first TODO keyword, =[X]= the first done
 156  keyword. Nested items become deeper headings.
 157- On other lines, makes each non-blank line a heading one level below the current entry.
 158  Comment lines are skipped.
 159
 160#+BEGIN_SRC org
 161,* Shopping
 162- [ ] milk
 163- [X] bread
 164#+END_SRC
 165
 166Selecting both items and pressing =C-c *= gives:
 167
 168#+BEGIN_SRC org
 169,* Shopping
 170,** TODO milk
 171,** DONE bread
 172#+END_SRC
 173
 174Toggle Item:
 175
 176- On a list item, with no selection, cycles the list's bullets (see [[*Bullets and numbering][Bullets and numbering]]).
 177- On items in a selection, removes their bullets.
 178- On headings, turns them into items. The tags, planning line and property drawer are
 179  removed. A TODO keyword becomes a checkbox, =[X]= for a done state and =[ ]= otherwise.
 180  The section's text is indented under the item.
 181- On other lines, puts a =-= bullet and a space in front of each non-blank line.
 182
 183In a table, =C-c *= recalculates and =C-c -= inserts a horizontal line instead (see
 184[[file:10-tables.org][Tables]]).
 185
 186Toggle COMMENT adds or removes the =COMMENT= keyword after the stars and TODO keyword.
 187Commented subtrees are left out of export and column view.
 188
 189** Selecting a subtree
 190
 191Mark Subtree (=org-mark-subtree=, =C-c @= in the Emacs and Doom presets) selects the
 192subtree at the caret, from its heading line to the end of its last line.
 193
 194* Subtrees as text
 195
 196** Cut, copy and paste
 197
 198| Command       | Org command          | Emacs         | Mac  | Doom                      |
 199|---------------+----------------------+---------------+------+---------------------------|
 200| Cut Subtree   | =org-cut-subtree=    | =C-c C-x C-w= | menu | =C-c C-x C-w=, =SPC m s d= |
 201| Copy Subtree  | =org-copy-subtree=   | =C-c C-x M-w= | menu | =C-c C-x M-w=             |
 202| Paste Subtree | =org-paste-subtree=  | =C-c C-x C-y= | menu | =C-c C-x C-y=             |
 203
 204The kill ring is the system clipboard. Cut Subtree and Copy Subtree put the subtree at
 205the caret, with the blank lines after it, on the clipboard and report its length.
 206
 207Paste Subtree takes the clipboard's text and adjusts its levels to fit where it lands.
 208The text has to start with a heading and contain no heading above its first one's
 209level; otherwise the command refuses. The level comes from:
 210
 211- an empty heading line, such as =***= followed by a space, at the caret: that level, and the empty line is
 212  replaced;
 213- the caret at the start of a heading: that heading's level, pasted before it;
 214- otherwise the deeper of the heading above the caret and the heading below it, pasted
 215  before the next heading.
 216
 217** Cloning with a time shift
 218
 219Clone Subtree with Time Shift (=org-clone-subtree-with-time-shift=, =C-c C-x c=, Doom
 220=SPC m s c=) asks for a number of clones, then, if the subtree has timestamps, for a
 221shift per clone such as =+1d=, =+1w=, =+2m= or =+1y= (units =h=, =d=, =w=, =m=, =y=).
 222Leave the shift empty to copy the dates unchanged.
 223
 224The clones are inserted after the subtree. The nth clone has its dates moved by n times
 225the shift. Clones lose their =CLOCK:= lines, and drawers left empty by that are removed.
 226An entry with an =:ID:= property gets a new ID in each clone. When the subtree has a
 227repeating timestamp and a shift is given, the repeater is removed from the clones, and
 228the original, with its repeater, moves after them with its dates shifted past the last
 229clone, as Org does.
 230
 231** Sorting
 232
 233Sort Entries (=org-sort=, =C-c ^=, Mac =⌃⇧⌘S=, Doom =SPC m s S=) sorts what the caret is in:
 234
 235- In a table, the table's lines (=org-table-sort-lines=, see [[file:10-tables.org][Tables]]).
 236- On a list item, the items of that list (=org-sort-list=).
 237- Otherwise headings (=org-sort-entries=): with a selection, the headings in it;
 238  on a heading, its children; before the first heading, the top-level headings.
 239
 240It then asks for a sort key, one keystroke. A capital letter sorts in reverse.
 241
 242| Key | Headings                                         | List items                           |
 243|-----+--------------------------------------------------+--------------------------------------|
 244| =a= | alphabetically by title                          | alphabetically by text               |
 245| =n= | numerically by the title's leading number        | numerically by the text              |
 246| =p= | priority                                         |                                      |
 247| =r= | a property's value (asks which property)         |                                      |
 248| =o= | TODO keyword, in sequence order                  |                                      |
 249| =t= | first active timestamp, else first timestamp     | first timestamp, or a timer          |
 250| =s= | =SCHEDULED= date                                 |                                      |
 251| =d= | =DEADLINE= date                                  |                                      |
 252| =c= | creation time: the first inactive timestamp at the start of a line |                    |
 253| =k= | clocked time in the subtree                      |                                      |
 254| =x= |                                                  | checkbox state                       |
 255
 256Alphabetical and numeric sorts ignore a leading =COMMENT=, link brackets and emphasis
 257markers. Sorting is stable, so entries with equal keys keep their order. Entries
 258without a date sort as if dated now. After sorting a list, its numbering is repaired.
 259Org's =f= (custom function) key is not available.
 260
 261* Narrowing
 262
 263| Command                    | Org command                      | Emacs     | Mac  | Doom       |
 264|----------------------------+----------------------------------+-----------+------+------------|
 265| Narrow to Subtree          | =org-narrow-to-subtree=          | =C-x n s= | menu | =SPC m s n= |
 266| Narrow to Block            | =org-narrow-to-block=            | =C-x n b= | menu | =C-x n b=  |
 267| Widen                      | =widen=                          | =C-x n w= | menu | =SPC m s N= |
 268| Narrow to Subtree or Widen | =org-toggle-narrow-to-subtree=   | speed key =s= | =⌃⌘N=, speed key =s= | speed key =s= |
 269
 270Narrowing hides everything outside the current subtree or block, so the editor shows
 271only that part of the file. Narrow to Block works on src, example, export, comment and
 272verse blocks (with the blank lines after them) and, for other blocks, on the lines
 273between the opening and closing lines. Edits inside the narrowed text move its bounds
 274as you type. Jumping to a position outside it, from a link, search or the outline pane,
 275widens first.
 276
 277Narrowing is a view. Commands still see the whole file: for example, a new footnote's
 278definition still goes into the =Footnotes= section at the end of the file, and a sparse
 279tree searches the whole file.
 280
 281* Sparse trees
 282
 283Sparse Tree… (=org-sparse-tree=, =C-c /=, Doom =SPC m s s=) folds the file to an
 284overview and then shows only the matches and the headings above them. It asks what to
 285match, one keystroke:
 286
 287| Key  | Shows                                                                 | Org function           |
 288|------+-----------------------------------------------------------------------+------------------------|
 289| =r=  | text matching a regular expression (asks for it); case-insensitive    | =org-occur=            |
 290| =t=  | headings with a TODO keyword that is not a done state                 | =org-show-todo-tree=   |
 291| =T=  | headings with the keywords you give (several separated by a vertical bar) | =org-show-todo-tree=   |
 292| =m=  | headings matching a tags and properties match                         | =org-match-sparse-tree= |
 293| =p=  | headings where a property has a value (asks for both, with completion) | =org-match-sparse-tree= |
 294| =d=  | deadlines past due or due within =org-deadline-warning-days= (14), in entries not done | =org-check-deadlines=  |
 295| =b=  | entries with a =SCHEDULED= or =DEADLINE= before a date                | =org-check-before-date= |
 296| =a=  | entries with a =SCHEDULED= or =DEADLINE= on or after a date           | =org-check-after-date= |
 297| =D=  | entries with a =SCHEDULED= or =DEADLINE= in a date range              | =org-check-dates-range= |
 298
 299The regular expression uses Emacs syntax. The match syntax for =m= is the one the
 300agenda's tags search uses (see [[file:07-agenda.org][Agenda]]). Dates are read as Org reads them (see
 301[[file:06-dates-and-clocking.org][Dates and clocking]]).
 302
 303For a text match, the whole entry around each match is shown; for heading matches,
 304the heading line. The matched text is highlighted, and the echo area reports the number
 305of matches. Subtrees tagged =ARCHIVE= stay folded. The highlights go away at the next
 306edit or with =C-c C-c=. =TAB= and =S-TAB= work as usual afterwards; cycling leaves the
 307sparse view.
 308
 309* Plain lists
 310
 311orgstar's list commands are ports of =org-list.el=. A list item starts with a bullet:
 312=-=, =+=, =*= (not at the left margin, where it would be a heading), or a number
 313followed by =.= or =)=. With alphabetical lists on, =a.=, =A.=, =a)= and =A)= are bullets
 314too. A description item has =::= after its term:
 315
 316#+BEGIN_SRC org
 317- milk
 318- eggs
 319  1. free range
 320  2. brown
 321- orgstar :: an org editor for macOS and iOS
 322#+END_SRC
 323
 324| Setting (=config.toml=)       | Settings ▸ Editing               | orgstar default | Org default |
 325|-------------------------------+----------------------------------+-----------------+-------------|
 326| =org-list-allow-alphabetical= | Lists can use letters (a. b. c.) | =true=          | =nil=       |
 327
 328** List commands
 329
 330| Command                   | Org command              | Emacs         | Mac    | Doom                              |
 331|---------------------------+--------------------------+---------------+--------+-----------------------------------|
 332| Insert Item               | =org-insert-item=        | =M-RET=       | =⌘↩=   | =M-RET=                           |
 333| Insert Checkbox Item      | =org-insert-item= with a checkbox | =M-S-RET= | =⇧⌘↩= | =M-S-RET=                       |
 334| Indent Item               | =org-indent-item=        | =M-<right>=   | =⌃⌘→=  | =M-l=; =C-t= in insert state      |
 335| Outdent Item              | =org-outdent-item=       | =M-<left>=    | =⌃⌘←=  | =M-h=; =C-d= in insert state      |
 336| Indent Item and Children  | =org-indent-item-tree=   | =M-S-<right>= | =⌃⌥⌘→= | =M-L=; =TAB= in insert state      |
 337| Outdent Item and Children | =org-outdent-item-tree=  | =M-S-<left>=  | =⌃⌥⌘←= | =M-H=; =S-TAB= in insert state    |
 338| Move Item Up              | =org-move-item-up=       | =M-<up>=      | =⌃⌥⌘↑= | =M-k=                             |
 339| Move Item Down            | =org-move-item-down=     | =M-<down>=    | =⌃⌥⌘↓= | =M-j=                             |
 340| Toggle Checkbox           | =org-toggle-checkbox=    | =C-c C-x C-b= | =⌃⌘C=  | =SPC m x=, =RET= in normal state  |
 341| Toggle Item               | =org-ctrl-c-minus=       | =C-c -=       | menu   | =SPC m i=                         |
 342
 343Insert Item works anywhere inside an item. The new item gets the next bullet: the same
 344symbol, the next number or the next letter. In a description list the new item has an
 345empty term followed by =::=, with the caret on the term. With =org-M-RET-may-split-line= on, text after the caret moves
 346to the new item; with it off (the orgstar default), the new item goes after the current
 347one. At the start of an item, the new item is inserted before it. If the list's items
 348are separated by blank lines, so is the new one.
 349
 350The indent, outdent and move commands need the caret on an item's first line.
 351
 352- Indent Item and Outdent Item move one item; its children stay where they are, and an
 353  item with children can't be outdented alone ("Cannot outdent an item without its
 354  children").
 355- The "and Children" variants move the item with its sub-items.
 356- On the first item of a list, Indent Item refuses; Indent Item and Children and
 357  Outdent Item and Children move the whole list. A list moved to the left margin
 358  changes =*= bullets to =-=.
 359- Move Item Up and Down swap the item, with its children, with the previous or next
 360  item at the same level.
 361
 362After every list command the list is repaired as Org repairs it: bullets are renumbered,
 363indentation is fixed and checkboxes of parent items are updated.
 364
 365** Bullets and numbering
 366
 367Toggle Item (=C-c -=) on an item, with no selection, cycles the bullet of the whole
 368list (=org-cycle-list-bullet=) through:
 369
 370=-=, =+=, =*=, =1.=, =1)=, then with alphabetical lists =a.=, =A.=, =a)=, =A)=.
 371
 372=*= is skipped for a list at the left margin. Description lists skip the numbered and
 373lettered bullets. Lettered bullets are offered only when the list has 26 items or
 374fewer. =S-<right>= and =S-<left>= on an item (Doom =C-S-l= and =C-S-h=) cycle forward
 375and backward.
 376
 377Numbered and lettered lists are renumbered whenever a list command changes them, and
 378by =C-c C-c= on any item. To start a list at a given number, put a counter after the
 379bullet, as in Org:
 380
 381#+BEGIN_SRC org
 3825. [@5] fifth
 3836. sixth
 384#+END_SRC
 385
 386* Checkboxes and statistics
 387
 388** Checkboxes
 389
 390An item with =[ ]= after its bullet has a checkbox. =[X]= is checked, and =[-]= marks a
 391parent item whose children are partly checked.
 392
 393#+BEGIN_SRC org
 394- [-] packing
 395  - [X] passport
 396  - [ ] charger
 397#+END_SRC
 398
 399Toggle Checkbox (=C-c C-x C-b=) checks or unchecks the item on the caret's line, or
 400every item in the selection. =C-c C-c= on an item toggles its checkbox too, and on an
 401item without one, repairs the list. A parent item's checkbox follows its children: it
 402can't be checked while children are unchecked ("Cannot toggle this checkbox: unchecked
 403subitems").
 404
 405Toggle Checkbox works only on item lines. Org's behaviour on a heading, toggling the
 406checkboxes of the region or subtree, is not available.
 407
 408** Radio lists
 409
 410A list with =:radio= in its =#+ATTR_ORG:= line, other than =:radio nil=, is a radio list:
 411checking one item unchecks the others. Toggle Checkbox and =C-c C-c= on an item check it
 412and uncheck the rest of its list (=org-toggle-radio-button=); items without a checkbox
 413get one.
 414
 415#+BEGIN_SRC org
 416,#+ATTR_ORG: :radio t
 417- [ ] tea
 418- [X] coffee
 419- [ ] water
 420#+END_SRC
 421
 422=C-c C-c= on an =#+ATTR_ORG:= or other affiliated keyword line of a list repairs the
 423list, as on an item without a checkbox. Org's =org-list-checkbox-radio-mode=, which makes
 424every list in a buffer a radio list, isn't available.
 425
 426** Statistics cookies
 427
 428A cookie =[/]= or =[%]= on a heading or an item shows progress:
 429
 430- On an item, it counts that item's direct child checkboxes.
 431- On a heading, it counts the checkboxes of the top-level items in the heading's own
 432  section. If the section has none, it counts the TODO children: direct child headings
 433  with a keyword, and how many of them are in a done state.
 434
 435#+BEGIN_SRC org
 436,* Groceries [1/3]
 437- [X] milk
 438- [ ] eggs
 439- [ ] bread
 440
 441,* Release [50%]
 442,** DONE Tag the build
 443,** TODO Write the notes
 444#+END_SRC
 445
 446Cookies update when you toggle or insert a checkbox, when a child heading's TODO state
 447changes, when you archive an entry, and when you press =C-c C-c= with the caret on the
 448cookie. A cookie with nothing to count shows =[0/0]= or =[100%]=. Tags are realigned when
 449the cookie's width changes.
 450
 451The =COOKIE_DATA= property changes what a heading's cookie counts, as in Org:
 452
 453| Value       | Effect                                                         |
 454|-------------+----------------------------------------------------------------|
 455| =todo=      | count TODO children, not checkboxes                            |
 456| =checkbox=  | count checkboxes, not TODO children                            |
 457| =recursive= | count all descendants, not only direct children                |
 458
 459For TODO statistics, =COOKIE_DATA= is read with inheritance, from the parent or an
 460ancestor. orgstar counts TODO children hierarchically, as Org does with
 461=org-hierarchical-todo-statistics= at its default.
 462
 463* Blocks
 464
 465Blocks are lines between =#+BEGIN_name= and =#+END_name=:
 466
 467#+BEGIN_SRC org
 468,#+BEGIN_QUOTE
 469Text to quote.
 470,#+END_QUOTE
 471#+END_SRC
 472
 473** Structure templates
 474
 475Insert Structure Template (=org-insert-structure-template=, =C-c C-,= in the Emacs and
 476Doom presets) asks for a block type by key. Org's default keys are:
 477
 478| Key | Block           |
 479|-----+-----------------|
 480| =a= | =export ascii=  |
 481| =c= | =center=        |
 482| =C= | =comment=       |
 483| =e= | =example=       |
 484| =E= | =export=        |
 485| =h= | =export html=   |
 486| =l= | =export latex=  |
 487| =q= | =quote=         |
 488| =s= | =src=           |
 489| =v= | =verse=         |
 490
 491Press =TAB= to type any other type. =[org-structure-template-alist]= in =config.toml=
 492adds templates or changes these (see [[file:13-configuration.org][Configuration]]). As in Org, keys of two letters
 493take two keystrokes: when several keys start with the same letter, that letter opens a
 494second choice, where =TAB= picks the one-letter key, so with =el= for =src emacs-lisp=,
 495=e TAB= inserts an example block and =e l= the Emacs Lisp block. The block is
 496inserted at the caret's indentation. With a selection, the block wraps the selected
 497lines, and for =src=, =example=, =export= and =comment= blocks, lines that would read as
 498headings or keywords are protected with a leading comma. For =src= and =export=, the
 499caret ends on the opening line after a space, ready for the language; otherwise it ends
 500inside the block. The case of =BEGIN= and =END= follows the case of the type you typed.
 501
 502** org-tempo templates
 503
 504Typing =<= and a key at the start of a line (after blanks only) and then completing
 505expands it as =org-tempo= does. =<s= becomes:
 506
 507#+BEGIN_SRC org
 508,#+begin_src
 509,#+end_src
 510#+END_SRC
 511
 512with the caret after =begin_src=. The keys are those of the structure templates above,
 513Org's and any in =config.toml=, plus =<L=,
 514=<H=, =<A= and =<i=, which insert =#+latex:=, =#+html:=, =#+ascii:= and =#+index:=
 515keyword lines.
 516
 517Completion runs with Complete at Point (=C-M-i= in the Emacs preset, =C-SPC= in Doom's
 518insert state; in the Mac preset, from the palette). In the Doom preset the completion
 519list also opens by itself after a short pause once you have typed =<= and a letter, and
 520=TAB= or =RET= takes the selected candidate. =TAB= alone does not expand =<s= in the
 521Emacs or Mac preset.
 522
 523** Folding and editing blocks
 524
 525=TAB= on a block's first or last line folds or unfolds it. Blocks are open when a file
 526opens unless =org-cycle-hide-block-startup= is on in =config.toml= or the file has
 527=#+STARTUP: hideblocks= (=nohideblocks= overrides the setting the other way). See
 528[[file:02-the-editor.org][The editor]] for folding in general.
 529
 530Edit Block (=org-edit-special=, =C-c '=, Mac =⌃⌘'=) edits a src, example or export block in a
 531separate editor. See [[file:11-code-blocks.org][Code blocks]].
 532
 533* Drawers
 534
 535A drawer is a named group of lines between =:NAME:= and =:END:=. orgstar writes the
 536=PROPERTIES= drawer for properties and, depending on =org-log-into-drawer=, a =LOGBOOK=
 537drawer for state notes and clock lines (see [[file:05-todos-and-tags.org][TODOs and tags]] and
 538[[file:06-dates-and-clocking.org][Dates and clocking]]). You can write any other drawer by hand:
 539
 540#+BEGIN_SRC org
 541,* Meeting
 542:NOTES:
 543Private notes, folded away.
 544:END:
 545#+END_SRC
 546
 547=TAB= on a drawer's first or last line folds or unfolds it. Drawers are folded when a
 548file opens, as with Org's =org-cycle-hide-drawer-startup= (=true= by default in
 549=config.toml=). =#+STARTUP: nohidedrawers= keeps them open in one file, and
 550=#+STARTUP: hidedrawers= folds them when the setting is off.
 551
 552Insert Drawer (=org-insert-drawer=, =C-c C-x d=) asks for a name. With no selection
 553it inserts an empty drawer on a new line; with a selection it puts the selected lines
 554in the drawer. A selection containing a heading is refused.
 555
 556* Properties
 557
 558Properties are key-value pairs in an entry's =PROPERTIES= drawer, right after the
 559heading and its planning line:
 560
 561#+BEGIN_SRC org
 562,* Laptop
 563:PROPERTIES:
 564:VENDOR:   Apple
 565:Effort:   1:00
 566:END:
 567#+END_SRC
 568
 569File-wide properties come from =#+PROPERTY:= lines and from a =PROPERTIES= drawer before
 570the first heading. A key written =KEY+= appends its value to the inherited one with a
 571space between.
 572
 573** Setting and deleting
 574
 575| Command                     | Org command                     | Emacs       | Mac  | Doom       |
 576|-----------------------------+---------------------------------+-------------+------+------------|
 577| Set Property…               | =org-set-property=              | =C-c C-x p= | =⌃⇧⌘P= | =SPC m o=  |
 578| Delete Property…            | =org-delete-property=           | none        | menu | none       |
 579| Delete Property Everywhere… | =org-delete-property-globally=  | none        | menu | none       |
 580| Property Action…            | =org-property-action=           | =C-c C-c= in a property drawer | =⌃⌘X= in a property drawer | =C-c C-c= |
 581| Next Allowed Value          | =org-property-next-allowed-value= | =S-<right>= on a property line | =⌃⇧⌘→= on a property line | =S-<right>=, =C-S-l= |
 582| Previous Allowed Value      | =org-property-previous-allowed-value= | =S-<left>= on a property line | =⌃⇧⌘←= on a property line | =S-<left>=, =C-S-h= |
 583
 584Set Property asks for the key, offering the keys used in the file, Org's standard keys
 585and the properties named in =COLUMNS= formats; on a property line, Return takes that
 586line's key. It then asks for the value. If the key has allowed values, those are
 587offered and required unless the list includes =:ETC=; otherwise the values the key has
 588elsewhere in the file are offered. An empty answer keeps the current value. The drawer
 589is created if the entry has none, and lines are aligned as Org's
 590=org-property-format= (="%-10s %s"=) aligns them. Setting =TODO= sets the entry's TODO
 591keyword instead.
 592
 593Delete Property asks which of the entry's properties to remove, when it has more than
 594one, and removes the drawer if it becomes empty. Delete Property Everywhere removes a key
 595from every entry in the file and reports how many it changed. Property Action, run by
 596=C-c C-c= in a property drawer, asks =s= (set), =d= (delete) or =D= (delete everywhere).
 597
 598** Allowed values
 599
 600A property =KEY_ALL= lists the values =KEY= may take, separated by spaces, with quotes
 601around values that contain spaces. orgstar looks for it on the entry, then its
 602ancestors, then the file:
 603
 604#+BEGIN_SRC org
 605,#+PROPERTY: Status_ALL open blocked done
 606#+END_SRC
 607
 608Next and Previous Allowed Value step through the list on a property line. =TODO= and
 609=PRIORITY= take their values from the file's keywords and priority range. A property
 610whose value is =[ ]= or =[X]= toggles between them.
 611
 612** Inheritance
 613
 614orgstar inherits properties as Org does with =org-use-property-inheritance=, set in
 615=config.toml=: =nil= (the default), =t= for all properties, or property names separated
 616by spaces, such as ="STYLE TEAM"=. An inherited property comes from the nearest ancestor
 617that has it, or from a =#+PROPERTY:= line. At =nil=, a property applies only to the entry
 618that has it, with these exceptions:
 619
 620- =CATEGORY=, =ARCHIVE=, =COLUMNS=, =LOGGING= and the =header-args= properties are
 621  always inherited from ancestors and =#+PROPERTY:= lines.
 622- =ID= and =CUSTOM_ID= are never inherited.
 623- =KEY_ALL= allowed values and =COOKIE_DATA= for TODO statistics are looked up through
 624  the ancestors.
 625
 626The setting applies to property lookups, agenda matches and habits (=STYLE=), as
 627Org's =selective= inheritance does.
 628
 629** Special properties
 630
 631Org computes some properties instead of reading them from a drawer. orgstar treats
 632these as special and doesn't offer them as allowed-value lists: =ALLTAGS=, =BLOCKED=,
 633=CLOCKSUM=, =CLOCKSUM_T=, =CLOSED=, =DEADLINE=, =FILE=, =ITEM=, =PRIORITY=, =SCHEDULED=,
 634=TAGS=, =TIMESTAMP=, =TIMESTAMP_IA= and =TODO=. Column view computes =ITEM=, =TODO=,
 635=PRIORITY=, =TAGS=, =ALLTAGS=, =DEADLINE=, =SCHEDULED=, =CLOSED= and =CLOCKSUM=; the
 636others show as empty there.
 637
 638* Column view
 639
 640Column view shows entries as rows and properties as columns. The columns come from a
 641=COLUMNS= format, found in this order:
 642
 6431. a =COLUMNS= property on the entry at the caret or one of its ancestors (the nearest
 644   one wins, and that entry becomes the top of the view);
 6452. a =#+COLUMNS:= line in the file;
 6463. Org's default, =%25ITEM %TODO %3PRIORITY %TAGS=.
 647
 648#+BEGIN_SRC org
 649,#+COLUMNS: %40ITEM %TODO %Effort(Estimate){:} %CLOCKSUM
 650#+END_SRC
 651
 652Each column is =%[width]PROPERTY[(title)][{summary}]=, as in Org. The width limits the
 653column, the title replaces the property name in the header, and the summary is computed
 654for parent entries from their children. The summary operators are =+=, =$=, =min=,
 655=max=, =mean=, =X=, =X/=, =X%=, =:=, =:min=, =:max=, =:mean=, =est+=, =@min=, =@max=
 656and =@mean=. The age operators take an active timestamp, as its age now, or a duration,
 657and show the youngest, oldest or mean age in days, hours and minutes (=3d 2h 15min=);
 658any other value stops the view with "Invalid age". The numeric operators take a
 659format after a semicolon, as in ={+;%.1f}=.
 660
 661Subtrees tagged =ARCHIVE= and commented subtrees are left out.
 662
 663** The column view sheet
 664
 665| Command             | Org command               | Emacs         | Mac  | Doom          |
 666|---------------------+---------------------------+---------------+------+---------------|
 667| Column View         | =org-columns=             | =C-c C-x C-c= | menu | =C-c C-x C-c= |
 668| Column View of File | =org-columns= with a prefix | none        | menu | none          |
 669
 670Column View opens a sheet with the entries from the view's top (the entry with the
 671=COLUMNS= property, or the entry at the caret; the whole file before the first
 672heading). Column View of File shows every entry in the file. Done (or Escape) closes
 673the sheet.
 674
 675Click a cell to select it; the arrow keys move the selection. Go to Entry shows the
 676selected entry's heading in the editor.
 677
 678| Key                     | Does                                                 | Org command                         |
 679|-------------------------+------------------------------------------------------+-------------------------------------|
 680| =e=, Return, double-click | Edits the value: type it, or pick an allowed value from the menu beside the field; Return sets it, Escape cancels | =org-columns-edit-value=  |
 681| =n=                     | The next allowed value                               | =org-columns-next-allowed-value=    |
 682| =p=                     | The previous allowed value                           | =org-columns-previous-allowed-value= |
 683
 684Editing goes through the commands Org uses: =ITEM= changes the headline, keeping its
 685keyword, priority and tags (=org-edit-headline=); =TODO= sets the keyword, with logging
 686and state notes (a note is asked for at the bottom of the sheet); =PRIORITY=, =TAGS=
 687(tags separated by spaces or colons), =SCHEDULED= and =DEADLINE= set those, an empty value
 688removing them; other columns set the property in the entry's drawer, under the column's
 689name in upper case, as Org writes it. =CLOCKSUM=, =ALLTAGS=, =CLOSED= and the other computed
 690columns can't be edited.
 691
 692The allowed values are the property's =_ALL= values from the entry, an ancestor or a
 693=#+PROPERTY:= line, the TODO keywords (and none) for =TODO=, the priorities for
 694=PRIORITY=, and =[ ]= and =[X]= for a column with an =X= summary. Without allowed values,
 695=n= and =p= say so. On =SCHEDULED= and =DEADLINE= they move the date a day later or
 696earlier; Org 9.8.7 signals an error there instead. After each change the sheet captures
 697the view again, so summaries follow. Parent summaries are not written into the file.
 698
 699On iOS, choose Column View or Column View of File from the editor's More menu. The view
 700scrolls both ways; tap a cell to select it. The bar at the bottom has Edit, which asks
 701for the value with the allowed values listed, Previous Value and Next Value (=p= and
 702=n=), and Go to Entry. Done closes it.
 703
 704** The Columns inspector
 705
 706View ▸ Show or Hide Columns and Clock opens an inspector beside the editor. Its Columns
 707tab shows the same table for the open file, kept current as you type. Choose File for
 708every entry or Subtree for the entry at the caret. The row of the heading at the caret
 709is shown in bold, and clicking a row goes to it. The Clock tab is described in
 710[[file:06-dates-and-clocking.org][Dates and clocking]].
 711
 712** Column view tables
 713
 714Insert Column View Table (=org-columns-insert-dblock=, =C-c C-x i=) asks what to
 715capture: =local= (the default, the entry at the caret), =global= (the whole file) or an
 716=ID= of an entry. It inserts a =columnview= dynamic block and fills it:
 717
 718#+BEGIN_SRC org
 719,#+BEGIN: columnview :hlines 1 :id local
 720| ITEM | TODO | PRIORITY | TAGS |
 721|------+------+----------+------|
 722| ...  |      |          |      |
 723,#+END:
 724#+END_SRC
 725
 726=C-c C-c= (Mac =⌃⌘X=) on the =#+BEGIN:= line, or =C-c C-x C-u= anywhere in the block, updates it.
 727Updating writes summary values into the parents' properties, as Org does. The block
 728takes these parameters:
 729
 730| Parameter          | Meaning                                                           |
 731|--------------------+-------------------------------------------------------------------|
 732| =:id=              | =local=, =global=, =file:PATH= (another file, all of it), or an entry's =ID= |
 733| =:match=           | keep entries matching a tag and property match, such as ="+work-home"= |
 734| =:format=          | a column format to use instead of the entry's or file's           |
 735| =:hlines=          | =t= for a line between all rows, or N for one before each level N or higher row |
 736| =:maxlevel=        | leave out deeper headings                                         |
 737| =:skip-empty-rows= | leave out rows whose columns other than =ITEM= are empty          |
 738| =:exclude-tags=    | leave out entries with these tags, as a list                      |
 739| =:indent=          | indent =ITEM= by level                                            |
 740
 741Existing =#+TBLFM:= lines after the table are kept. A =file:= path counts from this
 742file's folder. An =ID= is looked for in this file, then in the agenda files, as
 743=org-id-find= does. For another file the table is built from the file on disk, and the
 744summaries are not written into it; Org writes them into that file's buffer.
 745
 746* Footnotes
 747
 748| Command         | Org command          | Emacs       | Mac  | Doom        |
 749|-----------------+----------------------+-------------+------+-------------|
 750| Footnote Action | =org-footnote-action= | =C-c C-x f= | =⌃⇧⌘F= | =C-c C-x f= |
 751| Footnote Menu   | =org-footnote-action= with a prefix | none | menu | none |
 752
 753Footnote Action depends on where the caret is:
 754
 755- On a reference such as =[fn:1]=, it goes to the definition. If there is none, it asks
 756  whether to create one.
 757- On a definition's label, it goes back to a reference.
 758- Elsewhere, where a footnote is allowed, it inserts a new reference with the next free
 759  number and creates its definition.
 760- Where a footnote can't go, it shows the footnote menu.
 761
 762=C-c C-c= on a reference or a definition's label does the same jumps. After a jump to a
 763definition, the echo area says how to get back:
 764=Edit definition and go back with `C-c C-c' or `C-c C-x f' on its label.=
 765
 766New definitions go in a level 1 heading named =Footnotes= at the end of the file, which
 767is created when needed (Org's =org-footnote-section=):
 768
 769#+BEGIN_SRC org
 770,* Notes
 771orgstar reads org files.[fn:1]
 772
 773,* Footnotes
 774
 775[fn:1] And writes them.
 776#+END_SRC
 777
 778The footnote menu asks, one keystroke:
 779
 780| Key | Action                                                                     | Org function                 |
 781|-----+----------------------------------------------------------------------------+------------------------------|
 782| =s= | sort definitions into the order of their first reference                   | =org-footnote-sort=          |
 783| =r= | renumber numeric labels =fn:N= in order of appearance                     | =org-footnote-renumber-fn:N= |
 784| =S= | renumber, then sort                                                        |                              |
 785| =n= | normalize: number every footnote, labeled, anonymous and inline, and collect all definitions in the footnote section | =org-footnote-normalize= |
 786| =d= | delete the footnote at the caret: its references and definition           | =org-footnote-delete=        |
 787
 788A reference with no definition gets the text =DEFINITION NOT FOUND.= when sorted or
 789normalized.
 790
 791* Refiling
 792
 793Refile… (=org-refile=, =C-c C-w=, Mac =⌃⌘W=, Doom =SPC m r r= or =SPC m s r=) moves the
 794subtree at the caret under another heading, in this file or another one.
 795
 796It asks for the target with completion. By default the targets are every org file in
 797your folders and every heading down to level 3 in those files, written as the file's
 798path relative to its folder followed by the outline path:
 799
 800#+BEGIN_EXAMPLE
 801projects.org
 802projects.org/Work
 803projects.org/Work/Website
 804notes/inbox.org/Someday
 805#+END_EXAMPLE
 806
 807Choosing a heading makes the subtree its last child, at one level below it. Choosing a
 808file adds the subtree at the end of that file as a level 1 heading. Levels inside the
 809subtree are shifted to match, and tags are realigned. A subtree can't be refiled into
 810itself.
 811
 812For the open file, targets come from the buffer, including unsaved edits. When the
 813target is another file, orgstar writes that file first, into its open buffer if it has
 814one, otherwise through the normal save path, and removes the subtree from the source
 815only after that succeeds. If the target file changed on disk in the meantime, nothing
 816is refiled.
 817
 818Three settings in =config.toml= change the targets, as in Org (see [[file:13-configuration.org][Configuration]]):
 819
 820- =org-refile-targets=, written as Lisp: a list of =(FILES . SPEC)=. =FILES= is =nil=
 821  (the file you refile from), =org-agenda-files=, a file name, or a list of file names
 822  (relative to the current file's folder). =SPEC= is =(:maxlevel . N)=, =(:level . N)=,
 823  =(:tag . "TAG")=, =(:todo . "KEYWORD")=, =(:regexp . "RE")= or =t= for every heading;
 824  =(nil :maxlevel . 3)= is read the same way. The tag, keyword and regexp tests look at
 825  heading lines, case-sensitively.
 826
 827  #+BEGIN_SRC toml
 828  org-refile-targets = "((nil :maxlevel . 3) (org-agenda-files :tag . \"project\"))"
 829  #+END_SRC
 830
 831  Empty (the default) is the list above: every file, to level 3.
 832- =org-refile-use-outline-path=: how targets are written. =file= (the default) is the
 833  file then the outline path; =t= the outline path alone; =nil= the heading alone;
 834  =full-file-path= the file's full path then the outline path; =title= the file's
 835  =#+TITLE= (or its name) then the outline path; =buffer-name= as =file=. With =nil=, =t=
 836  and =buffer-name=, targets in other files end with the file's name in parentheses,
 837  and files are targets only with =file=, =full-file-path=, =title= and =buffer-name=. A
 838  =/= in a heading is written =\/=.
 839- =org-refile-allow-creating-parent-nodes=: with =t=, typing =TARGET/New heading=, where
 840  =TARGET= is one of the targets, adds =New heading= at the end of =TARGET= one level
 841  below it (or at the end of the file for a file) and refiles there; =confirm= asks
 842  first. On iOS the Refile sheet offers the new heading when the search field holds such
 843  a path.
 844
 845Otherwise this matches Org with =org-reverse-note-order= =nil= (new entries go last),
 846=org-log-refile= =nil= and =org-refile-keep= =nil=. Refiling from the agenda is covered
 847in [[file:07-agenda.org][Agenda]].
 848
 849Copy to Refile Target… (=org-copy=, =C-c M-w=) asks the same way and copies the
 850subtree there, leaving it in place. Go to Refile Target… (=C-u C-c C-w=, Doom
 851=SPC u SPC m r r=) asks the same way and jumps to the heading, or to the end of a file.
 852
 853* Archiving
 854
 855** Archive Subtree
 856
 857Archive Subtree (=org-archive-subtree=, =C-c C-x C-s= or =C-c $=, Mac =⌃⌘A=, Doom
 858=SPC m A= or =SPC m s A=) moves the subtree at the caret to an archive.
 859
 860The archive location is read from, in order: the =ARCHIVE= property of the entry or an
 861ancestor, a =#+ARCHIVE:= line in the file, and =org-archive-location= in =config.toml=
 862(Org's default =%s_archive::=). A location
 863is =file::heading=, where =%s= stands for the current file's name:
 864
 865| Location               | Where the subtree goes                                                     |
 866|------------------------+----------------------------------------------------------------------------|
 867| =%s_archive::=         | the end of =notes.org_archive= next to =notes.org=, at level 1             |
 868| =archive.org::* Old=   | under the heading =* Old= in =archive.org=, created if missing             |
 869| =::* Archived=         | under =* Archived= in the same file                                        |
 870| =%s_archive::datetree/= | under year, month and day headings in the archive file, for the entry's =CLOSED= date or today |
 871
 872Relative paths are relative to the current file's folder, and =~= is your home folder. A
 873new archive file starts with a line =Archived entries from file= followed by the
 874source's path.
 875
 876The archived entry gets these properties, as with Org's default
 877=org-archive-save-context-info=: =ARCHIVE_TIME=, =ARCHIVE_FILE=, =ARCHIVE_OLPATH=,
 878=ARCHIVE_CATEGORY=, =ARCHIVE_TODO= and =ARCHIVE_ITAGS= (empty ones are left out).
 879Within the same file, tags it inherited are added to its heading. After the subtree
 880leaves, the parent's statistics cookies are updated. The entry's TODO state is not
 881changed.
 882
 883If the archive file is open, the subtree goes into its buffer. Otherwise orgstar writes
 884the archive file first and removes the subtree from the source only after that
 885succeeds. Archiving from the agenda is covered in [[file:07-agenda.org][Agenda]].
 886
 887** The ARCHIVE tag
 888
 889Toggle ARCHIVE Tag (=org-toggle-archive-tag=, =C-c C-x a=, Doom =SPC m s a=) adds or
 890removes the =ARCHIVE= tag on the entry at the caret. Adding it folds the subtree.
 891
 892Subtrees tagged =ARCHIVE= stay where they are, but are folded when a file opens and in
 893sparse trees, and are left out of column view. =TAB= opens an archived subtree like
 894any other; Org's =org-cycle-open-archived-trees= behaviour, which keeps them closed, is
 895not reproduced. See [[file:05-todos-and-tags.org][TODOs and tags]] for tags in general.
 896
 897** Archive sibling
 898
 899Archive to Archive Sibling (=org-archive-to-archive-sibling=, =C-c C-x A=) moves the
 900subtree at the caret under a sibling heading named =Archive= with the =ARCHIVE= tag,
 901creating it at the end of the parent's children if needed. The moved entry gets an
 902=ARCHIVE_TIME= property, and the =Archive= sibling is folded.
 903
 904* Attachments
 905
 906An entry's attachments are files in a folder that belongs to it, as with org-attach. The folder is the entry's =DIR= property when it has one, relative to the file's folder unless absolute. Otherwise it comes from the entry's =ID=: =data/ab/cdef…= for the ID =abcdef…=, under the org file's folder. The first attachment gives an entry without either an =ID= property, and it gets the =ATTACH= tag. =attachment:= links open files in the folder (see [[file:09-links.org][Links]]).
 907
 908| Command | Emacs | What it does |
 909|-+-+-|
 910| Attach File… | =C-c C-a a= | Asks for files or folders and copies them into the folder. |
 911| Attach File by Moving…, as Hard Link…, as Symbolic Link… | =C-c C-a m=, =l=, =y= | The same, moving the files or linking to them. |
 912| Attach File from URL… | =C-c C-a u= | Downloads the URL as the name after its last =/=. |
 913| New Attachment… | =C-c C-a n= | Makes an empty file in the folder and opens it. |
 914| Open Attachment… | =C-c C-a o= | Opens the attachment, or asks which. Org files open in orgstar; others open in their app, or in Quick Look on iOS. |
 915| Show Attachment Folder | =C-c C-a f= | Shows the folder in the Finder (the Files app on iOS), making it if missing. |
 916| Delete Attachment… | =C-c C-a d= | Asks for an attachment and deletes it. |
 917| Delete All Attachments… | =C-c C-a D= | Asks, then deletes the folder and everything in it, and removes the =ATTACH= tag. |
 918| Sync Attachments | =C-c C-a z= | Adds =ATTACH= when the folder has files, removes it when it hasn't, and offers to delete an empty folder. |
 919| Set Attachment Folder… | =C-c C-a s= | Asks for a folder and sets =DIR= to its full path. When the entry had a folder already, offers to copy its files over and to delete it. |
 920| Unset Attachment Folder | =C-c C-a S= | Removes =DIR=, with the same offers when the folder changes. |
 921
 922The Doom keys are under =SPC m a=; see [[file:03-keys.org][Keys]]. Attaching a file stores an =attachment:= link to it, for Insert Link (=C-c C-l=). Deleting removes files for good, without the Trash.
 923
 924On iOS the commands are under More ▸ Attachments, with Attach Photo or Video… for the photo library. Moving and linking aren't offered there. Files, photos and videos shared to orgstar from another app are attached too: the share sheet offers Attach, and orgstar asks for the entry when it next opens.
 925
 926| Setting | Default | What it does |
 927|-+-+-|
 928| =org-attach-id-dir= | ="data/"= | The folder ID-based folders go in, relative to the org file's folder unless absolute. Folders under =data/= are still found when it's something else. |
 929| =org-attach-use-inheritance= | ="selective"= | Whether =DIR= and =ID= come from an ancestor: =selective= follows =org-use-property-inheritance=, ="t"= always, ="nil"= never. Doom sets =t=. |
 930
 931* Encrypted entries
 932
 933orgstar reads and writes entries encrypted by org-crypt with a passphrase (=org-crypt-key= nil, symmetric encryption). The text after the entry's planning line, property drawer and logbook, through the end of its subtree, is replaced by an OpenPGP message under the heading:
 934
 935#+begin_example
 936,* Secret :crypt:
 937-----BEGIN PGP MESSAGE-----
 938
 939ww0ECQMI…
 940-----END PGP MESSAGE-----
 941#+end_example
 942
 943| Command | What it does |
 944|-+-|
 945| Encrypt Entry… (=app.crypt.encrypt-entry=) | Asks for a passphrase twice and encrypts the entry at the caret (=org-encrypt-entry=). |
 946| Decrypt Entry… (=app.crypt.open-entry=) | Asks for the passphrase and shows the decrypted text in a sheet. Save encrypts the edited text again in the message's place; the file never holds the plaintext. Decrypt in File puts the text in the file instead. |
 947| Decrypt Entry in File… (=app.crypt.decrypt-entry=) | Replaces the message with the decrypted text (=org-decrypt-entry=). Headings in it are moved below the entry's level when they aren't. |
 948| Encrypt Tagged Entries… (=app.crypt.encrypt-entries=) | Encrypts every entry with the =crypt= tag, its own or inherited, that isn't encrypted yet (=org-encrypt-entries=). A tagged entry's tagged children go inside its message. |
 949| Forget Encryption Passphrase (=app.crypt.forget-passphrase=) | Removes the current file's passphrase from the Keychain. |
 950
 951The commands have no keys, as in Org; run them from the command palette, or bind them in =keymap.toml=. On iOS they are under More ▸ Encryption.
 952
 953Remember in the Keychain stores the passphrase for the file. The next command on that file uses it after Touch ID, Face ID or the device password, without asking. =org-crypt-tag-matcher= in =config.toml= sets the tag; it must be a single tag, not a match expression.
 954
 955Messages are written with AES-256 and an iterated and salted SHA-256 key, which GnuPG and Emacs read. Messages using AES-128, AES-192 or AES-256 are read, compressed or not. Messages encrypted to a public key, other ciphers, and AEAD (OpenPGP version 5 and 6) packets are not supported. Saving doesn't encrypt tagged entries, as =org-crypt-use-before-save-magic= does in Emacs; run Encrypt Tagged Entries….
 956
 957* The outline pane
 958
 959The outline pane, to the left of the editor, lists the headings of the open org file,
 960indented by level. Click a heading to go to it; folded text around it opens. A heading
 961with no title is shown as =(untitled)=.
 962
 963Show or hide it with the toolbar button or View ▸ Show or Hide Outline. orgstar
 964remembers the choice for org files; for other files the pane starts hidden and shows
 965"Only org files have an outline." Drag the divider to resize it. While the search field
 966has text, the pane shows search results instead. The backlinks pane, when shown, sits
 967below the outline (see [[file:09-links.org][Links]]).
 968
 969* C-c C-c
 970
 971=C-c C-c= (=org-ctrl-c-ctrl-c=) does what fits the caret's position. In the Emacs and
 972Doom presets it is =C-c C-c=; in the Mac preset it is =⌃⌘X=. In order, it:
 973
 974| Caret on                                   | Effect                                                     |
 975|--------------------------------------------+------------------------------------------------------------|
 976| anywhere, while sparse tree highlights show | removes the highlights, and nothing else (not in a table or src block) |
 977| a src block, a =#+CALL= line or inline code | runs it (see [[file:11-code-blocks.org][Code blocks]])                            |
 978| a table or =#+TBLFM= line                  | aligns the table, or recalculates it (see [[file:10-tables.org][Tables]])          |
 979| a footnote reference or definition label   | jumps between them                                         |
 980| a blank line                               | nothing                                                    |
 981| a =CLOCK:= line                            | fixes the weekdays and writes the duration again           |
 982| a dynamic block's =#+BEGIN:= line          | updates the block                                          |
 983| a statistics cookie                        | updates it                                                 |
 984| a timestamp                                | fixes its weekday                                          |
 985| a heading                                  | sets tags (see [[file:05-todos-and-tags.org][TODOs and tags]])                       |
 986| a list item                                | toggles its checkbox, repairs the list and updates cookies |
 987| a =#+KEYWORD:= line                        | rereads the file's settings and =#+SETUPFILE=              |
 988| a property drawer                          | runs Property Action                                       |
 989
 990Elsewhere it reports that it can do nothing useful.
 991
 992In the Doom preset, =RET= in normal state runs Doom's =+org/dwim-at-point= instead. It
 993follows a link, recalculates a table with formulas or aligns one without, runs a src
 994block, toggles an item's checkbox, or on a heading switches between the first TODO and
 995first done keyword of its sequence.
 996
 997* Speed keys
 998
 999With =org-use-speed-commands= set to =true= in =config.toml=, single keys run commands when the
1000caret is at the very start of a heading line, before the stars. These are Org's
1001=org-speed-commands=; the structure ones are:
1002
1003| Key | Command                       | Key | Command                    |
1004|-----+-------------------------------+-----+----------------------------|
1005| =n= | Next Heading                  | =U= | Move Subtree Up            |
1006| =p= | Previous Heading              | =D= | Move Subtree Down          |
1007| =f= | Next Heading at Same Level    | =r= | Demote Heading             |
1008| =b= | Previous Heading at Same Level | =l= | Promote Heading           |
1009| =u= | Up to Parent Heading          | =R= | Demote Subtree             |
1010| =j= | Go to Heading…                | =L= | Promote Subtree            |
1011| =s= | Narrow to Subtree or Widen    | =i= | Insert Heading After Subtree |
1012| =k= | Cut Subtree                   | =^= | Sort Entries               |
1013| =@= | Mark Subtree                  | =w= | Refile…                    |
1014| =#= | Toggle COMMENT                | =a= | Archive Subtree            |
1015| =/= | Sparse Tree…                  | =c=, =C= | cycle visibility, cycle global visibility |
1016
1017The full list is in [[file:03-keys.org][Keys]].
1018
1019* Not supported
1020
1021These Org structure features are not in orgstar:
1022
1023- Editing values in column view, and writing summaries from it; the
1024  =columnview= dynamic block does write summaries.
1025- The =ORDERED= property in the list commands.