docs/manual/guide/04-outlines.org

d85099bc95bf1766aee990d94671dacda0c0686e
orgstar/docs/manual/guide/04-outlines.org rendered · source · history · blame · raw

951 lines · 50550 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** Statistics cookies
409
410A cookie =[/]= or =[%]= on a heading or an item shows progress:
411
412- On an item, it counts that item's direct child checkboxes.
413- On a heading, it counts the checkboxes of the top-level items in the heading's own
414  section. If the section has none, it counts the TODO children: direct child headings
415  with a keyword, and how many of them are in a done state.
416
417#+BEGIN_SRC org
418,* Groceries [1/3]
419- [X] milk
420- [ ] eggs
421- [ ] bread
422
423,* Release [50%]
424,** DONE Tag the build
425,** TODO Write the notes
426#+END_SRC
427
428Cookies update when you toggle or insert a checkbox, when a child heading's TODO state
429changes, when you archive an entry, and when you press =C-c C-c= with the caret on the
430cookie. A cookie with nothing to count shows =[0/0]= or =[100%]=. Tags are realigned when
431the cookie's width changes.
432
433The =COOKIE_DATA= property changes what a heading's cookie counts, as in Org:
434
435| Value       | Effect                                                         |
436|-------------+----------------------------------------------------------------|
437| =todo=      | count TODO children, not checkboxes                            |
438| =checkbox=  | count checkboxes, not TODO children                            |
439| =recursive= | count all descendants, not only direct children                |
440
441For TODO statistics, =COOKIE_DATA= is read with inheritance, from the parent or an
442ancestor. orgstar counts TODO children hierarchically, as Org does with
443=org-hierarchical-todo-statistics= at its default.
444
445* Blocks
446
447Blocks are lines between =#+BEGIN_name= and =#+END_name=:
448
449#+BEGIN_SRC org
450,#+BEGIN_QUOTE
451Text to quote.
452,#+END_QUOTE
453#+END_SRC
454
455** Structure templates
456
457Insert Structure Template (=org-insert-structure-template=, =C-c C-,= in the Emacs and
458Doom presets) asks for a block type by key. Org's default keys are:
459
460| Key | Block           |
461|-----+-----------------|
462| =a= | =export ascii=  |
463| =c= | =center=        |
464| =C= | =comment=       |
465| =e= | =example=       |
466| =E= | =export=        |
467| =h= | =export html=   |
468| =l= | =export latex=  |
469| =q= | =quote=         |
470| =s= | =src=           |
471| =v= | =verse=         |
472
473Press =TAB= to type any other type. =[org-structure-template-alist]= in =config.toml=
474adds templates or changes these (see [[file:13-configuration.org][Configuration]]). As in Org, keys of two letters
475take two keystrokes: when several keys start with the same letter, that letter opens a
476second choice, where =TAB= picks the one-letter key, so with =el= for =src emacs-lisp=,
477=e TAB= inserts an example block and =e l= the Emacs Lisp block. The block is
478inserted at the caret's indentation. With a selection, the block wraps the selected
479lines, and for =src=, =example=, =export= and =comment= blocks, lines that would read as
480headings or keywords are protected with a leading comma. For =src= and =export=, the
481caret ends on the opening line after a space, ready for the language; otherwise it ends
482inside the block. The case of =BEGIN= and =END= follows the case of the type you typed.
483
484** org-tempo templates
485
486Typing =<= and a key at the start of a line (after blanks only) and then completing
487expands it as =org-tempo= does. =<s= becomes:
488
489#+BEGIN_SRC org
490,#+begin_src
491,#+end_src
492#+END_SRC
493
494with the caret after =begin_src=. The keys are those of the structure templates above,
495Org's and any in =config.toml=, plus =<L=,
496=<H=, =<A= and =<i=, which insert =#+latex:=, =#+html:=, =#+ascii:= and =#+index:=
497keyword lines.
498
499Completion runs with Complete at Point (=C-M-i= in the Emacs preset, =C-SPC= in Doom's
500insert state; in the Mac preset, from the palette). In the Doom preset the completion
501list also opens by itself after a short pause once you have typed =<= and a letter, and
502=TAB= or =RET= takes the selected candidate. =TAB= alone does not expand =<s= in the
503Emacs or Mac preset.
504
505** Folding and editing blocks
506
507=TAB= on a block's first or last line folds or unfolds it. Blocks are open when a file
508opens unless =org-cycle-hide-block-startup= is on in =config.toml= or the file has
509=#+STARTUP: hideblocks= (=nohideblocks= overrides the setting the other way). See
510[[file:02-the-editor.org][The editor]] for folding in general.
511
512Edit Block (=org-edit-special=, =C-c '=, Mac =⌃⌘'=) edits a src, example or export block in a
513separate editor. See [[file:11-code-blocks.org][Code blocks]].
514
515* Drawers
516
517A drawer is a named group of lines between =:NAME:= and =:END:=. orgstar writes the
518=PROPERTIES= drawer for properties and, depending on =org-log-into-drawer=, a =LOGBOOK=
519drawer for state notes and clock lines (see [[file:05-todos-and-tags.org][TODOs and tags]] and
520[[file:06-dates-and-clocking.org][Dates and clocking]]). You can write any other drawer by hand:
521
522#+BEGIN_SRC org
523,* Meeting
524:NOTES:
525Private notes, folded away.
526:END:
527#+END_SRC
528
529=TAB= on a drawer's first or last line folds or unfolds it. Drawers are folded when a
530file opens, as with Org's =org-cycle-hide-drawer-startup= (=true= by default in
531=config.toml=). =#+STARTUP: nohidedrawers= keeps them open in one file, and
532=#+STARTUP: hidedrawers= folds them when the setting is off.
533
534Insert Drawer (=org-insert-drawer=, =C-c C-x d=) asks for a name. With no selection
535it inserts an empty drawer on a new line; with a selection it puts the selected lines
536in the drawer. A selection containing a heading is refused.
537
538* Properties
539
540Properties are key-value pairs in an entry's =PROPERTIES= drawer, right after the
541heading and its planning line:
542
543#+BEGIN_SRC org
544,* Laptop
545:PROPERTIES:
546:VENDOR:   Apple
547:Effort:   1:00
548:END:
549#+END_SRC
550
551File-wide properties come from =#+PROPERTY:= lines and from a =PROPERTIES= drawer before
552the first heading. A key written =KEY+= appends its value to the inherited one with a
553space between.
554
555** Setting and deleting
556
557| Command                     | Org command                     | Emacs       | Mac  | Doom       |
558|-----------------------------+---------------------------------+-------------+------+------------|
559| Set Property…               | =org-set-property=              | =C-c C-x p= | =⌃⇧⌘P= | =SPC m o=  |
560| Delete Property…            | =org-delete-property=           | none        | menu | none       |
561| Delete Property Everywhere… | =org-delete-property-globally=  | none        | menu | none       |
562| Property Action…            | =org-property-action=           | =C-c C-c= in a property drawer | =⌃⌘X= in a property drawer | =C-c C-c= |
563| Next Allowed Value          | =org-property-next-allowed-value= | =S-<right>= on a property line | =⌃⇧⌘→= on a property line | =S-<right>=, =C-S-l= |
564| Previous Allowed Value      | =org-property-previous-allowed-value= | =S-<left>= on a property line | =⌃⇧⌘←= on a property line | =S-<left>=, =C-S-h= |
565
566Set Property asks for the key, offering the keys used in the file, Org's standard keys
567and the properties named in =COLUMNS= formats; on a property line, Return takes that
568line's key. It then asks for the value. If the key has allowed values, those are
569offered and required unless the list includes =:ETC=; otherwise the values the key has
570elsewhere in the file are offered. An empty answer keeps the current value. The drawer
571is created if the entry has none, and lines are aligned as Org's
572=org-property-format= (="%-10s %s"=) aligns them. Setting =TODO= sets the entry's TODO
573keyword instead.
574
575Delete Property asks which of the entry's properties to remove, when it has more than
576one, and removes the drawer if it becomes empty. Delete Property Everywhere removes a key
577from every entry in the file and reports how many it changed. Property Action, run by
578=C-c C-c= in a property drawer, asks =s= (set), =d= (delete) or =D= (delete everywhere).
579
580** Allowed values
581
582A property =KEY_ALL= lists the values =KEY= may take, separated by spaces, with quotes
583around values that contain spaces. orgstar looks for it on the entry, then its
584ancestors, then the file:
585
586#+BEGIN_SRC org
587,#+PROPERTY: Status_ALL open blocked done
588#+END_SRC
589
590Next and Previous Allowed Value step through the list on a property line. =TODO= and
591=PRIORITY= take their values from the file's keywords and priority range. A property
592whose value is =[ ]= or =[X]= toggles between them.
593
594** Inheritance
595
596orgstar inherits properties as Org does with =org-use-property-inheritance=, set in
597=config.toml=: =nil= (the default), =t= for all properties, or property names separated
598by spaces, such as ="STYLE TEAM"=. An inherited property comes from the nearest ancestor
599that has it, or from a =#+PROPERTY:= line. At =nil=, a property applies only to the entry
600that has it, with these exceptions:
601
602- =CATEGORY=, =ARCHIVE=, =COLUMNS=, =LOGGING= and the =header-args= properties are
603  always inherited from ancestors and =#+PROPERTY:= lines.
604- =ID= and =CUSTOM_ID= are never inherited.
605- =KEY_ALL= allowed values and =COOKIE_DATA= for TODO statistics are looked up through
606  the ancestors.
607
608The setting applies to property lookups, agenda matches and habits (=STYLE=), as
609Org's =selective= inheritance does.
610
611** Special properties
612
613Org computes some properties instead of reading them from a drawer. orgstar treats
614these as special and doesn't offer them as allowed-value lists: =ALLTAGS=, =BLOCKED=,
615=CLOCKSUM=, =CLOCKSUM_T=, =CLOSED=, =DEADLINE=, =FILE=, =ITEM=, =PRIORITY=, =SCHEDULED=,
616=TAGS=, =TIMESTAMP=, =TIMESTAMP_IA= and =TODO=. Column view computes =ITEM=, =TODO=,
617=PRIORITY=, =TAGS=, =ALLTAGS=, =DEADLINE=, =SCHEDULED=, =CLOSED= and =CLOCKSUM=; the
618others show as empty there.
619
620* Column view
621
622Column view shows entries as rows and properties as columns. The columns come from a
623=COLUMNS= format, found in this order:
624
6251. a =COLUMNS= property on the entry at the caret or one of its ancestors (the nearest
626   one wins, and that entry becomes the top of the view);
6272. a =#+COLUMNS:= line in the file;
6283. Org's default, =%25ITEM %TODO %3PRIORITY %TAGS=.
629
630#+BEGIN_SRC org
631,#+COLUMNS: %40ITEM %TODO %Effort(Estimate){:} %CLOCKSUM
632#+END_SRC
633
634Each column is =%[width]PROPERTY[(title)][{summary}]=, as in Org. The width limits the
635column, the title replaces the property name in the header, and the summary is computed
636for parent entries from their children. The summary operators are =+=, =$=, =min=,
637=max=, =mean=, =X=, =X/=, =X%=, =:=, =:min=, =:max=, =:mean=, =est+=, =@min=, =@max=
638and =@mean=. The age operators take an active timestamp, as its age now, or a duration,
639and show the youngest, oldest or mean age in days, hours and minutes (=3d 2h 15min=);
640any other value stops the view with "Invalid age". The numeric operators take a
641format after a semicolon, as in ={+;%.1f}=.
642
643Subtrees tagged =ARCHIVE= and commented subtrees are left out.
644
645** The column view sheet
646
647| Command             | Org command               | Emacs         | Mac  | Doom          |
648|---------------------+---------------------------+---------------+------+---------------|
649| Column View         | =org-columns=             | =C-c C-x C-c= | menu | =C-c C-x C-c= |
650| Column View of File | =org-columns= with a prefix | none        | menu | none          |
651
652Column View opens a sheet with the entries from the view's top (the entry with the
653=COLUMNS= property, or the entry at the caret; the whole file before the first
654heading). Column View of File shows every entry in the file. Done (or Escape) closes
655the sheet.
656
657Click a cell to select it; the arrow keys move the selection. Go to Entry shows the
658selected entry's heading in the editor.
659
660| Key                     | Does                                                 | Org command                         |
661|-------------------------+------------------------------------------------------+-------------------------------------|
662| =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=  |
663| =n=                     | The next allowed value                               | =org-columns-next-allowed-value=    |
664| =p=                     | The previous allowed value                           | =org-columns-previous-allowed-value= |
665
666Editing goes through the commands Org uses: =ITEM= changes the headline, keeping its
667keyword, priority and tags (=org-edit-headline=); =TODO= sets the keyword, with logging
668and state notes (a note is asked for at the bottom of the sheet); =PRIORITY=, =TAGS=
669(tags separated by spaces or colons), =SCHEDULED= and =DEADLINE= set those, an empty value
670removing them; other columns set the property in the entry's drawer, under the column's
671name in upper case, as Org writes it. =CLOCKSUM=, =ALLTAGS=, =CLOSED= and the other computed
672columns can't be edited.
673
674The allowed values are the property's =_ALL= values from the entry, an ancestor or a
675=#+PROPERTY:= line, the TODO keywords (and none) for =TODO=, the priorities for
676=PRIORITY=, and =[ ]= and =[X]= for a column with an =X= summary. Without allowed values,
677=n= and =p= say so. On =SCHEDULED= and =DEADLINE= they move the date a day later or
678earlier; Org 9.8.7 signals an error there instead. After each change the sheet captures
679the view again, so summaries follow. Parent summaries are not written into the file.
680
681On iOS, choose Column View or Column View of File from the editor's More menu. The view
682scrolls both ways; tap a cell to select it. The bar at the bottom has Edit, which asks
683for the value with the allowed values listed, Previous Value and Next Value (=p= and
684=n=), and Go to Entry. Done closes it.
685
686** The Columns inspector
687
688View ▸ Show or Hide Columns and Clock opens an inspector beside the editor. Its Columns
689tab shows the same table for the open file, kept current as you type. Choose File for
690every entry or Subtree for the entry at the caret. The row of the heading at the caret
691is shown in bold, and clicking a row goes to it. The Clock tab is described in
692[[file:06-dates-and-clocking.org][Dates and clocking]].
693
694** Column view tables
695
696Insert Column View Table (=org-columns-insert-dblock=, =C-c C-x i=) asks what to
697capture: =local= (the default, the entry at the caret), =global= (the whole file) or an
698=ID= of an entry. It inserts a =columnview= dynamic block and fills it:
699
700#+BEGIN_SRC org
701,#+BEGIN: columnview :hlines 1 :id local
702| ITEM | TODO | PRIORITY | TAGS |
703|------+------+----------+------|
704| ...  |      |          |      |
705,#+END:
706#+END_SRC
707
708=C-c C-c= (Mac =⌃⌘X=) on the =#+BEGIN:= line, or =C-c C-x C-u= anywhere in the block, updates it.
709Updating writes summary values into the parents' properties, as Org does. The block
710takes these parameters:
711
712| Parameter          | Meaning                                                           |
713|--------------------+-------------------------------------------------------------------|
714| =:id=              | =local=, =global=, or an entry's =ID=                             |
715| =:format=          | a column format to use instead of the entry's or file's           |
716| =:hlines=          | =t= for a line between all rows, or N for one before each level N or higher row |
717| =:maxlevel=        | leave out deeper headings                                         |
718| =:skip-empty-rows= | leave out rows whose columns other than =ITEM= are empty          |
719| =:exclude-tags=    | leave out entries with these tags, as a list                      |
720| =:indent=          | indent =ITEM= by level                                            |
721
722Existing =#+TBLFM:= lines after the table are kept. An =:id= of the form =file:path=
723(another file) is not supported.
724
725* Footnotes
726
727| Command         | Org command          | Emacs       | Mac  | Doom        |
728|-----------------+----------------------+-------------+------+-------------|
729| Footnote Action | =org-footnote-action= | =C-c C-x f= | =⌃⇧⌘F= | =C-c C-x f= |
730| Footnote Menu   | =org-footnote-action= with a prefix | none | menu | none |
731
732Footnote Action depends on where the caret is:
733
734- On a reference such as =[fn:1]=, it goes to the definition. If there is none, it asks
735  whether to create one.
736- On a definition's label, it goes back to a reference.
737- Elsewhere, where a footnote is allowed, it inserts a new reference with the next free
738  number and creates its definition.
739- Where a footnote can't go, it shows the footnote menu.
740
741=C-c C-c= on a reference or a definition's label does the same jumps. After a jump to a
742definition, the echo area says how to get back:
743=Edit definition and go back with `C-c C-c' or `C-c C-x f' on its label.=
744
745New definitions go in a level 1 heading named =Footnotes= at the end of the file, which
746is created when needed (Org's =org-footnote-section=):
747
748#+BEGIN_SRC org
749,* Notes
750orgstar reads org files.[fn:1]
751
752,* Footnotes
753
754[fn:1] And writes them.
755#+END_SRC
756
757The footnote menu asks, one keystroke:
758
759| Key | Action                                                                     | Org function                 |
760|-----+----------------------------------------------------------------------------+------------------------------|
761| =s= | sort definitions into the order of their first reference                   | =org-footnote-sort=          |
762| =r= | renumber numeric labels =fn:N= in order of appearance                     | =org-footnote-renumber-fn:N= |
763| =S= | renumber, then sort                                                        |                              |
764| =n= | normalize: number every footnote, labeled, anonymous and inline, and collect all definitions in the footnote section | =org-footnote-normalize= |
765| =d= | delete the footnote at the caret: its references and definition           | =org-footnote-delete=        |
766
767A reference with no definition gets the text =DEFINITION NOT FOUND.= when sorted or
768normalized.
769
770* Refiling
771
772Refile… (=org-refile=, =C-c C-w=, Mac =⌃⌘W=, Doom =SPC m r r= or =SPC m s r=) moves the
773subtree at the caret under another heading, in this file or another one.
774
775It asks for the target with completion. By default the targets are every org file in
776your folders and every heading down to level 3 in those files, written as the file's
777path relative to its folder followed by the outline path:
778
779#+BEGIN_EXAMPLE
780projects.org
781projects.org/Work
782projects.org/Work/Website
783notes/inbox.org/Someday
784#+END_EXAMPLE
785
786Choosing a heading makes the subtree its last child, at one level below it. Choosing a
787file adds the subtree at the end of that file as a level 1 heading. Levels inside the
788subtree are shifted to match, and tags are realigned. A subtree can't be refiled into
789itself.
790
791For the open file, targets come from the buffer, including unsaved edits. When the
792target is another file, orgstar writes that file first, into its open buffer if it has
793one, otherwise through the normal save path, and removes the subtree from the source
794only after that succeeds. If the target file changed on disk in the meantime, nothing
795is refiled.
796
797Three settings in =config.toml= change the targets, as in Org (see [[file:13-configuration.org][Configuration]]):
798
799- =org-refile-targets=, written as Lisp: a list of =(FILES . SPEC)=. =FILES= is =nil=
800  (the file you refile from), =org-agenda-files=, a file name, or a list of file names
801  (relative to the current file's folder). =SPEC= is =(:maxlevel . N)=, =(:level . N)=,
802  =(:tag . "TAG")=, =(:todo . "KEYWORD")=, =(:regexp . "RE")= or =t= for every heading;
803  =(nil :maxlevel . 3)= is read the same way. The tag, keyword and regexp tests look at
804  heading lines, case-sensitively.
805
806  #+BEGIN_SRC toml
807  org-refile-targets = "((nil :maxlevel . 3) (org-agenda-files :tag . \"project\"))"
808  #+END_SRC
809
810  Empty (the default) is the list above: every file, to level 3.
811- =org-refile-use-outline-path=: how targets are written. =file= (the default) is the
812  file then the outline path; =t= the outline path alone; =nil= the heading alone;
813  =full-file-path= the file's full path then the outline path; =title= the file's
814  =#+TITLE= (or its name) then the outline path; =buffer-name= as =file=. With =nil=, =t=
815  and =buffer-name=, targets in other files end with the file's name in parentheses,
816  and files are targets only with =file=, =full-file-path=, =title= and =buffer-name=. A
817  =/= in a heading is written =\/=.
818- =org-refile-allow-creating-parent-nodes=: with =t=, typing =TARGET/New heading=, where
819  =TARGET= is one of the targets, adds =New heading= at the end of =TARGET= one level
820  below it (or at the end of the file for a file) and refiles there; =confirm= asks
821  first. On iOS the Refile sheet offers the new heading when the search field holds such
822  a path.
823
824Otherwise this matches Org with =org-reverse-note-order= =nil= (new entries go last),
825=org-log-refile= =nil= and =org-refile-keep= =nil=. Refiling from the agenda is covered
826in [[file:07-agenda.org][Agenda]].
827
828Copy to Refile Target… (=org-copy=, =C-c M-w=) asks the same way and copies the
829subtree there, leaving it in place. Go to Refile Target… (=C-u C-c C-w=, Doom
830=SPC u SPC m r r=) asks the same way and jumps to the heading, or to the end of a file.
831
832* Archiving
833
834** Archive Subtree
835
836Archive Subtree (=org-archive-subtree=, =C-c C-x C-s= or =C-c $=, Mac =⌃⌘A=, Doom
837=SPC m A= or =SPC m s A=) moves the subtree at the caret to an archive.
838
839The archive location is read from, in order: the =ARCHIVE= property of the entry or an
840ancestor, a =#+ARCHIVE:= line in the file, and =org-archive-location= in =config.toml=
841(Org's default =%s_archive::=). A location
842is =file::heading=, where =%s= stands for the current file's name:
843
844| Location               | Where the subtree goes                                                     |
845|------------------------+----------------------------------------------------------------------------|
846| =%s_archive::=         | the end of =notes.org_archive= next to =notes.org=, at level 1             |
847| =archive.org::* Old=   | under the heading =* Old= in =archive.org=, created if missing             |
848| =::* Archived=         | under =* Archived= in the same file                                        |
849| =%s_archive::datetree/= | under year, month and day headings in the archive file, for the entry's =CLOSED= date or today |
850
851Relative paths are relative to the current file's folder, and =~= is your home folder. A
852new archive file starts with a line =Archived entries from file= followed by the
853source's path.
854
855The archived entry gets these properties, as with Org's default
856=org-archive-save-context-info=: =ARCHIVE_TIME=, =ARCHIVE_FILE=, =ARCHIVE_OLPATH=,
857=ARCHIVE_CATEGORY=, =ARCHIVE_TODO= and =ARCHIVE_ITAGS= (empty ones are left out).
858Within the same file, tags it inherited are added to its heading. After the subtree
859leaves, the parent's statistics cookies are updated. The entry's TODO state is not
860changed.
861
862If the archive file is open, the subtree goes into its buffer. Otherwise orgstar writes
863the archive file first and removes the subtree from the source only after that
864succeeds. Archiving from the agenda is covered in [[file:07-agenda.org][Agenda]].
865
866** The ARCHIVE tag
867
868Toggle ARCHIVE Tag (=org-toggle-archive-tag=, =C-c C-x a=, Doom =SPC m s a=) adds or
869removes the =ARCHIVE= tag on the entry at the caret. Adding it folds the subtree.
870
871Subtrees tagged =ARCHIVE= stay where they are, but are folded when a file opens and in
872sparse trees, and are left out of column view. =TAB= opens an archived subtree like
873any other; Org's =org-cycle-open-archived-trees= behaviour, which keeps them closed, is
874not reproduced. See [[file:05-todos-and-tags.org][TODOs and tags]] for tags in general.
875
876** Archive sibling
877
878Archive to Archive Sibling (=org-archive-to-archive-sibling=, =C-c C-x A=) moves the
879subtree at the caret under a sibling heading named =Archive= with the =ARCHIVE= tag,
880creating it at the end of the parent's children if needed. The moved entry gets an
881=ARCHIVE_TIME= property, and the =Archive= sibling is folded.
882
883* The outline pane
884
885The outline pane, to the left of the editor, lists the headings of the open org file,
886indented by level. Click a heading to go to it; folded text around it opens. A heading
887with no title is shown as =(untitled)=.
888
889Show or hide it with the toolbar button or View ▸ Show or Hide Outline. orgstar
890remembers the choice for org files; for other files the pane starts hidden and shows
891"Only org files have an outline." Drag the divider to resize it. While the search field
892has text, the pane shows search results instead. The backlinks pane, when shown, sits
893below the outline (see [[file:09-links.org][Links]]).
894
895* C-c C-c
896
897=C-c C-c= (=org-ctrl-c-ctrl-c=) does what fits the caret's position. In the Emacs and
898Doom presets it is =C-c C-c=; in the Mac preset it is =⌃⌘X=. In order, it:
899
900| Caret on                                   | Effect                                                     |
901|--------------------------------------------+------------------------------------------------------------|
902| anywhere, while sparse tree highlights show | removes the highlights, and nothing else (not in a table or src block) |
903| a src block, a =#+CALL= line or inline code | runs it (see [[file:11-code-blocks.org][Code blocks]])                            |
904| a table or =#+TBLFM= line                  | aligns the table, or recalculates it (see [[file:10-tables.org][Tables]])          |
905| a footnote reference or definition label   | jumps between them                                         |
906| a blank line                               | nothing                                                    |
907| a =CLOCK:= line                            | fixes the weekdays and writes the duration again           |
908| a dynamic block's =#+BEGIN:= line          | updates the block                                          |
909| a statistics cookie                        | updates it                                                 |
910| a timestamp                                | fixes its weekday                                          |
911| a heading                                  | sets tags (see [[file:05-todos-and-tags.org][TODOs and tags]])                       |
912| a list item                                | toggles its checkbox, repairs the list and updates cookies |
913| a =#+KEYWORD:= line                        | rereads the file's settings and =#+SETUPFILE=              |
914| a property drawer                          | runs Property Action                                       |
915
916Elsewhere it reports that it can do nothing useful.
917
918In the Doom preset, =RET= in normal state runs Doom's =+org/dwim-at-point= instead. It
919follows a link, recalculates a table with formulas or aligns one without, runs a src
920block, toggles an item's checkbox, or on a heading switches between the first TODO and
921first done keyword of its sequence.
922
923* Speed keys
924
925With =org-use-speed-commands= set to =true= in =config.toml=, single keys run commands when the
926caret is at the very start of a heading line, before the stars. These are Org's
927=org-speed-commands=; the structure ones are:
928
929| Key | Command                       | Key | Command                    |
930|-----+-------------------------------+-----+----------------------------|
931| =n= | Next Heading                  | =U= | Move Subtree Up            |
932| =p= | Previous Heading              | =D= | Move Subtree Down          |
933| =f= | Next Heading at Same Level    | =r= | Demote Heading             |
934| =b= | Previous Heading at Same Level | =l= | Promote Heading           |
935| =u= | Up to Parent Heading          | =R= | Demote Subtree             |
936| =j= | Go to Heading…                | =L= | Promote Subtree            |
937| =s= | Narrow to Subtree or Widen    | =i= | Insert Heading After Subtree |
938| =k= | Cut Subtree                   | =^= | Sort Entries               |
939| =@= | Mark Subtree                  | =w= | Refile…                    |
940| =#= | Toggle COMMENT                | =a= | Archive Subtree            |
941| =/= | Sparse Tree…                  | =c=, =C= | cycle visibility, cycle global visibility |
942
943The full list is in [[file:03-keys.org][Keys]].
944
945* Not supported
946
947These Org structure features are not in orgstar:
948
949- Editing values in column view, and writing summaries from it; the
950  =columnview= dynamic block does write summaries.
951- The =ORDERED= property, radio lists and timer list items in the list commands.