krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

docs/manual/guide/03-keys.org

ab6ccec56eca03d0dadf2c9332aab10c4490eb62
orgstar/docs/manual/guide/03-keys.org rendered · source · history · blame · raw

1038 lines · 80713 bytes

   1#+TITLE: Keys and commands
   2#+DESCRIPTION: The three key presets, prefix keys and key hints, the echo area, the command palette, Option as Meta, keymap.toml, Vim editing in the Doom preset, and every binding.
   3#+LEDE: Every action in Orgstar is a named command; a keymap preset decides which keys run which commands, and keymap.toml lets you change that.
   4
   5* Commands and keymaps
   6
   7Each action has a command id such as =org.todo.cycle= and a title such as /Cycle TODO State/. Keys, the Org menu, the command palette and the iOS key bar all run commands by id. A keymap maps key sequences to command ids. Orgstar ships three keymaps, called presets, and reads your own bindings from =keymap.toml= on top of the one you choose.
   8
   9Ids starting with =org.= are Org commands and run only in Org files. Ids starting with =edit.= are text-system actions (movement, killing, find). Ids starting with =app.= are carried out by the app: saving, buffers, windows, export. =editor.= ids change how the editor behaves. The [[*Key reference][key reference]] at the end of this chapter lists every bound command with its keys in each preset.
  10
  11* Choosing a preset
  12
  13Choose a preset in Settings ▸ General ▸ Keys, or with =keymap= in the =[orgstar]= table of =config.toml= (see [[file:13-configuration.org][Configuration]]). The change applies at once.
  14
  15| Preset | =config.toml= value | What it is |
  16|-+-+-|
  17| Emacs | ="emacs"= | Emacs and Org keys: =C-f=, =C-k=, =C-x C-s=, =C-c C-t=, =M-RET=, =M-<left>=. The default. |
  18| Mac | ="mac"= | Standard macOS text keys stay as they are. Org commands use Control-Command chords (=⌃⌘T=, =⌃⌘←=), which macOS text editing leaves free. |
  19| Doom (Vim keys) | ="doom"= | Modal editing as in Doom Emacs with evil and evil-org: normal, insert and visual states, the =SPC= leader and =SPC m= local leader, plus the Emacs preset's Org keys in every state. |
  20
  21The Mac preset binds fewer commands than the others. =⌃⌘X= is its =C-c C-c=, =⌘K= inserts a link and =⇧⌘E= opens the export sheet; the [[*Key reference][key reference]] lists the rest. It has no keys for agenda, capture or the single export formats. Run those from the Org menu, from the command palette (=⇧⌘P=), from a menu shortcut (Agenda =⇧⌘A=, Capture =⇧⌘N=), or bind them yourself in =keymap.toml=.
  22
  23In the Emacs and Mac presets, and in Doom's insert state, macOS's own text keys keep working where the preset does not bind the key: =⌥←=, =⌘←=, =⇧= with arrows to select, and the Control keys the macOS text system provides (=⌃A=, =⌃E=, =⌃K= and so on). Menu shortcuts such as =⌘S= and =⌘F= work in every preset; see [[*Menu shortcuts][Menu shortcuts]].
  24
  25* Option as Meta
  26
  27Emacs notation writes Meta as =M-=. On a Mac keyboard Meta is the Option key, but Option also types characters such as =é= and =ø=. Settings ▸ General ▸ Option as Meta picks which Option keys act as Meta:
  28
  29| Choice | =config.toml= (=option-as-meta= in =[orgstar]=) | Effect |
  30|-+-+-|
  31| Left Option | ="left"= | The left Option key is Meta; the right one types characters. The default. |
  32| Right Option | ="right"= | The right Option key is Meta. |
  33| Both | ="both"= | Both are Meta; Option no longer types special characters in the editor. |
  34| Neither | ="none"= | Option always types characters. Plain =M-= keys such as =M-f= cannot be typed; chords that also use Control or Command still work. |
  35
  36Option pressed together with Control or Command always counts as Meta, whatever this setting says, so chords such as =C-M-i= (=⌃⌥I=) and the Mac preset's =⌃⌥⌘←= always work.
  37
  38* How keys reach commands
  39
  40** Contexts
  41
  42One key can run different commands depending on where the caret is. In the Emacs preset =M-<right>= demotes a heading, indents a list item and moves a table column right. Each binding can name a context, and Orgstar tries the bindings for a key from the highest priority down. The first one whose context holds and whose command can run at the caret wins.
  43
  44| Context | Holds when |
  45|-+-|
  46| =heading= | The caret is on a heading line. |
  47| =item= | The caret is inside a list item. |
  48| =table= | The caret is inside a table. |
  49| =tblfm= | The caret is on a =#+TBLFM:= line. |
  50| =timestamp= | The caret is on a timestamp. |
  51| =property= | The caret is on a property line in a property drawer. |
  52| =src= | The caret is inside a src block. |
  53| =dblock= | The caret is on the =#+BEGIN:= line of a dynamic block. |
  54| =fold-line= | The caret is on the first or last line of a drawer or block, where =TAB= folds it. |
  55| =region= | Text is selected. |
  56| =speed= | Speed keys are on, nothing is selected, and the caret is at the very start of a heading line. See [[*Speed keys][Speed keys]]. |
  57
  58When no binding for a key applies:
  59
  60- In the Emacs and Mac presets, a single key goes to the text system and does what it normally does. =TAB= outside a heading, drawer edge or table types a tab; =S-<right>= on plain text extends the selection.
  61- A key sequence of two or more keys runs its highest-priority command anyway, so you see that command's message (for example "Not on a heading").
  62- In the Doom preset the keys go on to the Vim engine (see [[*Vim editing (Doom preset)][Vim editing]]).
  63
  64In a file that is not an Org file, =org.= commands never apply, so their keys fall through as above.
  65
  66** Prefix keys and key hints
  67
  68A prefix is a key that starts longer sequences, such as =C-c=, =C-c C-x=, =C-x n= or, in the Doom preset, =SPC= and =SPC m=. After a prefix, Orgstar waits for the next key and shows the keys typed so far in the echo area, followed by a dash: =C-c C-x-=.
  69
  70If you pause on a prefix for 0.6 seconds, a panel of key hints opens above the echo area. It lists each key that can follow, sorted by key, with the title of the command it runs, or =+prefix= when it leads to a longer sequence. This is Orgstar's version of =which-key=. The hints follow the current keymap, including your =keymap.toml=, and in the Doom preset the current evil state. When a key has several contexts (=C-c C-c= is the common case), the hint shows the command that would run at the caret; where none of them applies, it shows the highest-priority one.
  71
  72=C-g= during a prefix cancels it; in the Emacs and Mac presets the echo area shows =Quit=. A sequence that nothing binds shows, for example, =C-c z is undefined= and does nothing. In the Doom preset this holds for sequences that start with =SPC= or with a Control or Meta key; see [[*How keys are handled][How keys are handled]] for the others.
  73
  74A key bound by itself cannot also be a prefix. When a keymap binds both =C-c= and =C-c C-t=, =C-c= always waits for the next key, so the binding for =C-c= alone never runs.
  75
  76* The echo area
  77
  78The echo area is the line at the bottom of the window, below the modeline. It shows, in order of priority:
  79
  80- A question a command is asking, with a text field: a refile target, a date, a property value, a sparse-tree match, a Vim search or ex command. =Return= answers, =Esc= cancels. When the question has choices, they are listed above the field and filtered as you type with fuzzy matching; =Tab= completes the best match. Date questions show a calendar, and =S-<left>=, =S-<right>=, =S-<up>= and =S-<down>= move the date by a day or a week, as in =org-read-date=.
  81- Fast selection for TODO keywords and tags when the file defines keys for them (see [[file:05-todos-and-tags.org][TODOs and tags]]).
  82- The pending prefix, such as =C-c C-x-=.
  83- The last message from a command or from the keymap, for four seconds.
  84
  85In the Doom preset the modeline shows the evil state as a tag: =NORMAL=, =INSERT=, =VISUAL=, =V-LINE= or =V-BLOCK=. See [[file:02-the-editor.org][The editor]] for the rest of the modeline.
  86
  87* The command palette
  88
  89The palette lists every command by title with its keys in the current keymap. Open it with:
  90
  91- =⇧⌘P= or File ▸ Command Palette… in every preset,
  92- =M-x= in the Emacs and Doom presets (=execute-extended-command=),
  93- =SPC := in Doom normal state.
  94
  95Type part of a title; matching is fuzzy and the best matches come first. =Return= runs the top match, a click runs any row, and =Esc= closes the palette. Each row shows up to two key sequences; in the Doom preset these are normal-state keys first, then insert-state keys.
  96
  97The palette leaves out text-system movement and editing commands (Forward Character, Kill Line, Set Mark and the like), which only make sense from keys. Every other command is in it, including the ones no preset binds, such as Show or Hide Backlinks, Import Table from File…, Recovery Versions… and Delete Property…. Commands that cannot run at the caret show a message instead.
  98
  99The Org menu in the menu bar lists every =org.= command with its keys in the current keymap, and is a way to find a key without the palette. Its Clock submenu lists the clock commands the same way, followed by the recently clocked entries.
 100
 101* Menu shortcuts
 102
 103These come from the menu bar and work in every preset. In the Doom preset, keys with =⌘= always go to the menus.
 104
 105| Menu | Item | Key |
 106|-+-+-|
 107| Orgstar | Settings… | =⌘,= |
 108| Orgstar | Edit Config File | =⌥⌘,= |
 109| File | Add Folder… | =⇧⌘O= |
 110| File | Quick Open… | =⌘P= |
 111| File | Command Palette… | =⇧⌘P= |
 112| File | Capture… | =⇧⌘N= |
 113| File | Close Buffer (closes other windows themselves) | =⌘W= |
 114| File | Close Window | =⇧⌘W= |
 115| File | Save | =⌘S= |
 116| File | Save All | =⌥⌘S= |
 117| Edit ▸ Find | Find… | =⌘F= |
 118| Edit ▸ Find | Find and Replace… | =⌥⌘F= |
 119| Edit ▸ Find | Find Next | =⌘G= |
 120| Edit ▸ Find | Find Previous | =⇧⌘G= |
 121| Edit ▸ Find | Use Selection for Find | =⌘E= |
 122| Edit | Cancel Running Task | =⌘.= |
 123| Edit | Search Notes | =⇧⌘F= |
 124| View | Show Markup | =⇧⌘M= |
 125| View | Show Line Numbers | =⇧⌘L= |
 126| View | Show or Hide Outline | =⌥⌘O= |
 127| View | Show or Hide Columns and Clock | =⌥⌘I= |
 128| Window | Agenda | =⇧⌘A= |
 129| Window | Board | =⇧⌘B= |
 130| Window | Next Buffer | =⇧⌘]= |
 131| Window | Previous Buffer | =⇧⌘[= |
 132
 133View ▸ Show or Hide Backlinks and Show Tab Bar, Window ▸ Switch to Buffer…, and the items of File ▸ Export have no shortcut.
 134
 135With Settings ▸ Capture ▸ "⌃⌥Space opens Capture from any app" on (the default), =⌃⌥Space= opens the Capture window from any application (see [[file:08-capture.org][Capture]]).
 136
 137* Speed keys
 138
 139With =org-use-speed-commands= set to =true= in =config.toml=, single letters typed at the very start of a heading line, before the stars, run commands instead of inserting text (=org-speed-commands=). Anywhere else the letters type as usual. The setting is off by default and has no checkbox in Settings.
 140
 141Speed keys work in the Emacs and Mac presets, and in the Doom preset in insert state. The full list is in the [[*Speed keys reference][speed keys reference]].
 142
 143* Customizing keys: keymap.toml
 144
 145Your own bindings go in =keymap.toml= in the configuration folder: =$XDG_CONFIG_HOME/orgstar/keymap.toml= when =XDG_CONFIG_HOME= is set, otherwise =~/.config/orgstar/keymap.toml=. Settings ▸ General shows the path under the Keys picker. The file does not exist until you create it. If you used an earlier version that kept it in =~/Library/Application Support/Orgstar/=, that copy is read, and reloaded when you save it, until one exists in the configuration folder.
 146
 147The bindings in the file are layered on top of the chosen preset. They apply to whichever preset is chosen, so a file written for the Emacs preset does nothing useful under Doom unless its bindings name a =mode=.
 148
 149** Format
 150
 151The file is a list of =[[bind]]= tables, one per binding:
 152
 153#+BEGIN_SRC toml
 154# C-c t cycles the TODO keyword.
 155[[bind]]
 156keys = "C-c t"
 157command = "org.todo.cycle"
 158#+END_SRC
 159
 160| Field | Required | Meaning |
 161|-+-+-|
 162| =keys= | yes | The key sequence, in Emacs notation, chords separated by spaces. |
 163| =command= | yes | A command id, or ="none"= to unbind. |
 164| =when= | no | A context from the table in [[*Contexts][Contexts]]. Without it the binding holds everywhere. |
 165| =mode= | no | An evil state for the Doom preset: ="normal"=, ="insert"= or ="visual"=. |
 166
 167The [[*Key reference][key reference]] gives each command's id after its title. Commands no preset binds are listed under [[*Unbound commands][Unbound commands]]. A binding whose command id Orgstar does not know is skipped and reported when the file loads (see [[*Reloading and errors][Reloading and errors]]).
 168
 169Orgstar reads a subset of TOML: =[[bind]]= headers, =key = value= lines, basic ="..."= and literal ='...'= strings, =true= and =false=, integers, and =#= comments. Arrays, inline tables and multi-line strings are not supported.
 170
 171** Key notation
 172
 173| Notation | Key |
 174|-+-|
 175| =C-= | Control (=⌃=) |
 176| =M-= | Meta: Option (=⌥=), as set in [[*Option as Meta][Option as Meta]] |
 177| =S-= | Shift (=⇧=) |
 178| =s-= | Command (=⌘=) |
 179| =a=, =%=, =/= | A single character |
 180| =TAB=, =RET=, =SPC=, =ESC=, =DEL= | Tab, Return, Space, Escape, Delete (backspace) |
 181| =<left>=, =<right>=, =<up>=, =<down>= | Arrow keys |
 182| =<home>=, =<end>=, =<prior>=, =<next>= | Home, End, Page Up, Page Down |
 183| =<delete>= | Forward delete (=⌦=) |
 184| =<f1>= to =<f12>= | Function keys |
 185
 186Modifiers combine: =C-M-s-<left>= is =⌃⌥⌘←=. =<tab>=, =<return>=, =<escape>= and =<backspace>= are accepted as other names for =TAB=, =RET=, =ESC= and =DEL=, and =<backtab>= for =S-TAB=.
 187
 188Shift with a letter is written as the capital letter: =S-a= and =A= are the same key, and so are =C-S-h= and =C-H=. With other keys Shift stays a modifier: =S-TAB=, =S-<up>=, =M-S-RET=.
 189
 190A backslash in a basic string must be doubled. These two lines are the same key, =⌃⌘\=:
 191
 192#+BEGIN_SRC toml
 193keys = "C-s-\\"
 194keys = 'C-s-\'
 195#+END_SRC
 196
 197** Priority
 198
 199Bindings are read in order: the preset first, then your file from top to bottom. When several bindings have the same keys, later ones are tried first. A binding in your file without =when= therefore takes its keys everywhere, hiding every context-specific preset binding for them. A binding with =when= is tried first only in its context; elsewhere the preset's bindings still apply.
 200
 201#+BEGIN_SRC toml
 202# M-RET in a table inserts a row; on headings and items it does what the preset says.
 203[[bind]]
 204keys = "M-RET"
 205command = "org.table.insert-row"
 206when = "table"
 207#+END_SRC
 208
 209** Unbinding
 210
 211Set =command= to ="none"= to remove a key. A ="none"= binding without =when= hides every earlier binding of exactly those keys, so the key goes to the text system (or, in the Doom preset, to Vim):
 212
 213#+BEGIN_SRC toml
 214# Leave C-t to macOS's transpose and C-k to its kill.
 215[[bind]]
 216keys = "C-t"
 217command = "none"
 218[[bind]]
 219keys = "C-k"
 220command = "none"
 221#+END_SRC
 222
 223Limitations:
 224
 225- A ="none"= binding with =when= has no effect. You cannot unbind a key in one context only; bind it to another command in that context instead.
 226- Unbinding a prefix does not remove the longer sequences under it. Unbinding =C-c C-x= leaves =C-c C-x C-i= and the rest working. Unbind each sequence you want gone.
 227
 228** Doom states
 229
 230In the Doom preset every binding belongs to a state. A binding without =mode= never runs in the Doom preset, and a binding with =mode= never runs in the Emacs or Mac preset. =mode = "visual"= covers visual, visual-line and visual-block. To bind a key in more than one state, write one table per state:
 231
 232#+BEGIN_SRC toml
 233# SPC n a opens the agenda.
 234[[bind]]
 235keys = "SPC n a"
 236command = "app.agenda"
 237mode = "normal"
 238
 239# C-c n inserts a heading in normal and insert state.
 240[[bind]]
 241keys = "C-c n"
 242command = "org.heading.insert"
 243mode = "normal"
 244[[bind]]
 245keys = "C-c n"
 246command = "org.heading.insert"
 247mode = "insert"
 248#+END_SRC
 249
 250A =mode= other than =normal=, =insert= or =visual= (including =visual-line=) is reported when the file loads, and the binding is skipped.
 251
 252** More examples
 253
 254#+BEGIN_SRC toml
 255# Mac preset: ⌃⌘U goes up to the parent heading, ⌃⌘R opens column view, ⌃⌘; toggles COMMENT.
 256[[bind]]
 257keys = "C-s-u"
 258command = "org.heading.up"
 259[[bind]]
 260keys = "C-s-r"
 261command = "org.columns"
 262[[bind]]
 263keys = "C-s-;"
 264command = "org.heading.toggle-comment"
 265
 266# Emacs preset: C-c b opens the board, C-c r reloads this file.
 267[[bind]]
 268keys = "C-c b"
 269command = "app.board"
 270[[bind]]
 271keys = "C-c r"
 272command = "app.reload-keymap"
 273
 274#+END_SRC
 275
 276** Reloading and errors
 277
 278Orgstar watches the configuration folder and reloads =keymap.toml= when you save it. It also reloads when you change the preset, and when you run Reload Keymap (=app.reload-keymap=, in the palette, and =SPC h r r= in Doom normal state), which shows =Keymap reloaded=.
 279
 280Problems are reported in the echo area with the line number, for example =keymap.toml: line 12: unknown context tabel (and 1 more)=. A binding with bad or missing =keys=, a missing =command=, a command id Orgstar does not know, an unknown =when= or =mode=, or a table other than =[[bind]]= is skipped; the rest of the file still applies. A file that is not valid TOML is ignored as a whole and the error is shown; the preset alone applies until you fix it.
 281
 282** Importing from Emacs
 283
 284Settings ▸ General ▸ Import from Emacs… reads your Emacs or Doom configuration and offers, among other things, the key bindings it finds: =global-set-key=, =keymap-global-set=, =define-key=, =keymap-set=, =evil-define-key= and Doom's =map!= with =:leader=, =:localleader=, state keywords and =:prefix=. Bindings to commands Orgstar has are appended to =keymap.toml= under a =# Imported from Emacs.= comment, leaving out bindings the file already has. Keys written as vectors, such as =[f5]=, are skipped. See [[file:15-alongside-emacs.org][Alongside Emacs]].
 285
 286* Vim editing (Doom preset)
 287
 288The Doom preset edits modally, as Doom Emacs does with =evil=, =evil-org=, =evil-surround=, =evil-snipe= and =evil-nerd-commenter=. Orgstar implements these itself; none of them are Emacs packages running inside it. The caret is a block in normal and visual states and a bar in insert state, and the modeline shows the state.
 289
 290** How keys are handled
 291
 292Each key goes first to the keymap for the current state, then to the Vim engine:
 293
 2941. Keys with =⌘= go to the menus.
 2952. If a Vim command is half typed (after =d=, ="a=, =3= and so on), the key goes to Vim.
 2963. Otherwise the keymap gets the key. A prefix such as =SPC=, =g=, =z=, =[=, =]=, =C-c= or =C-x= waits for the next key, with key hints as described above. A complete sequence runs its command if the binding's context holds and the command can run at the caret.
 2974. Anything the keymap does not take goes to Vim, as typed. In insert state, keys Vim does not handle are typed as text.
 298
 299Two consequences:
 300
 301- Keymap commands do not take counts or registers. Once you type a count or a register, the following keys go straight to Vim.
 302- A sequence the keymap does not complete after =SPC=, =C-c=, =C-x= or another Control or Meta prefix is undefined: the echo area shows, for example, =SPC j is undefined=, and nothing runs. After =g=, =z=, =[= or =]=, which are Vim prefixes too, the keys are replayed into Vim, so =gu= and =gq= reach the Vim engine although the keymap binds other =g= keys.
 303
 304** States
 305
 306| State | Enter with | Leave with |
 307|-+-+-|
 308| Normal | =ESC=, =C-[= or =C-g= from insert state; =ESC= from visual | — |
 309| Insert | =i=, =a=, =I=, =A=, =o=, =O=, =c= commands, =cc=, =C=, block =I=, =A=, =c= | =ESC=, =C-[=, =C-g= |
 310| Visual | =v= | =v=, =ESC= |
 311| Visual line | =V= | =V=, =ESC= |
 312| Visual block | =C-v= | =C-v=, =ESC= |
 313
 314Leaving insert state moves the caret back one character, as in Vim. A mouse click leaves visual state. In the keymap, ="visual"= is the state name for all three visual states.
 315
 316In insert state, =C-w= deletes the word before the caret and =C-u= deletes back to the line's indentation (or to the start of the line when the caret is already there). The rest of insert state is the Emacs preset's Org keys, the Doom insert-state keys in the reference (=TAB= and =S-TAB= on headings, items and tables, =C-t= and =C-d=, =C-S-h/j/k/l=, =C-SPC= for completion) and ordinary typing.
 317
 318** Motions
 319
 320Motions move the caret in normal state, extend the selection in visual states, and give the range for an operator. A count before a motion repeats it.
 321
 322| Keys | Moves |
 323|-+-|
 324| =h=, =l=, =<left>=, =<right>=, =DEL= | Left, right; =DEL= is =h=. Stays on the line. |
 325| =j=, =k=, =<down>=, =<up>= | Down, up, keeping the column. |
 326| =gj=, =gk= | In Org files, to the next or previous Org element (=org-forward-element=, =org-backward-element=, as evil-org binds them); counts are ignored. On a heading, =gj= goes to the next heading after the subtree and =gk= to the previous heading at the same level or higher. In other files, down and up by screen lines in wrapped text. |
 327| =+=, =-=, =RET= | First non-blank of the next or previous line. In Org files =RET= runs Act at Point instead. |
 328| =w=, =b=, =e=, =ge= | Next word start, previous word start, word end, previous word end. |
 329| =W=, =B=, =E=, =gE= | The same for blank-separated WORDs. |
 330| =0=, =<home>= | Start of the line. |
 331| =^= | First non-blank of the line. |
 332| =$=, =<end>= | End of the line; with a count, of the line count − 1 lines down. |
 333| =g_= | Last non-blank of the line. |
 334| =gg=, =G= | First line, last line; with a count, that line. The column is kept (=evil-start-of-line= nil). |
 335| =f= /x/, =F= /x/, =t= /x/, =T= /x/ | To, or to just before, the next or previous /x/ on the line. These are one-character snipes, as Doom's =evil-snipe-override-mode= makes them. /x/ also matches its accented and other variants, as Doom's =evil-snipe-char-fold= makes it: =a= matches =à=, =À=, =ª= and =a=. A lowercase /x/ matches either case, a capital only capitals; =t= and =T= skip a match right next to the caret; =f SPC= and =t SPC= skip a run of blanks after the caret and stop at the last blank before the next word, or just before it. |
 336| =;=, =,= | Repeats the last snipe (=s=, =S=, =f=, =F=, =t= or =T=), forward or reversed. A repeat searches all the text the window shows, so it can go past the caret's line (=evil-snipe-repeat-scope=, as Doom sets it). Right after a snipe, its own key repeats it: =f= goes on in the same direction and =F= reverses, and the same for =t= and =T= and for =s= and =S=. A count typed right after a snipe ends this: the key after the count starts a new snipe with that count, so =f a 2 f a= goes to the next /a/, then to the second /a/ after it. |
 337| =s= /xy/, =S= /xy/ | evil-snipe: to the next or previous /xy/ on the line. Each character matches its variants as for =f=, and /xy/ without a capital matches case-insensitively. =SPC= and =TAB= are read as a space and a tab. Not available after an operator. |
 338| =%= | The bracket matching the next =()=, =[]= or ={}= on the line. |
 339| ={=, =}= | Previous, next blank line. |
 340| =/=, =?= | Asks in the echo area for a regular expression and searches forward or backward, wrapping around the file. |
 341| =n=, =N= | Repeats the last search in the same or the opposite direction. |
 342| =*=, =#= | Searches forward or backward for the whole word under the caret. |
 343| =C-d=, =C-u= | Down, up half the window's height; with a count, that many lines. |
 344| =H=, =M=, =L= | First non-blank of the top, middle or bottom line the window shows. With a count, =H= goes to that line from the top and =L= from the bottom. Lines are text lines, not wrapped screen lines. Linewise after an operator. |
 345| ='= /a/, =`= /a/ | To mark /a/: its line's first non-blank, or its exact position. See [[*Marks and jumps][Marks and jumps]]. |
 346
 347Search patterns are ICU regular expressions as macOS uses them, close to PCRE; Emacs and Vim regexp syntax such as =\(...\)= or =\<= does not work. =:noh= is accepted and does nothing; searches are not highlighted.
 348
 349** Operators
 350
 351| Keys | Does |
 352|-+-|
 353| =d= /motion/ | Deletes. =dd= deletes lines. |
 354| =c= /motion/ | Deletes and enters insert state. =cc= keeps the line's indentation; =cw= changes to the end of the word, as =ce=. |
 355| =y= /motion/ | Yanks (copies). =yy= yanks lines. |
 356| =>= /motion/, =<= /motion/ | Indents or outdents lines by 8 spaces (=evil-shift-width=, which Doom sets to Org's =tab-width=). =>>= and =<<= act on lines. |
 357| =g~= /motion/, =gu= /motion/, =gU= /motion/ | Toggles case, lowercases, uppercases. =g~~=, =guu=, =gUU= act on lines. |
 358| =gc= /motion/ | Comments or uncomments lines with =#= (=evilnc-comment-operator=). =gcc= acts on lines. See [[*Commenting][Commenting]]. |
 359| =gq= /motion/, =gw= /motion/ | Fills the paragraphs in the motion's lines to the fill column, as Fill Paragraph does; other elements in the lines are left alone. =gq= leaves the caret on the first non-blank of the last line, =gw= where it was. Extra spaces between words and at the ends of lines are kept, as Doom fills without squeezing them. =gqq= and =gww= act on lines. |
 360
 361=M-q= runs Fill Paragraph in normal, insert and visual state. In visual and visual-line state it fills every paragraph the selection touches and leaves the caret where it was. In visual-block state it fills the paragraph at the caret, as evil does with =transient-mark-mode= off. In each, if the text changed, the editor returns to normal state, otherwise the selection stays.
 362
 363Counts multiply: =2d3w= deletes six words. Doubling an operator with a count acts on that many lines: =3dd=.
 364
 365Single-key changes:
 366
 367| Keys | Does |
 368|-+-|
 369| =x=, =<delete>= | Deletes the character under the caret (count: that many, within the line). |
 370| =X= | Deletes the character before the caret. |
 371| =D=, =C= | Deletes, or changes, to the end of the line. |
 372| =Y= | Yanks to the end of the line (=evil-want-Y-yank-to-eol=, as Doom sets it). |
 373| =p=, =P= | Pastes after or before the caret; whole lines go below or above the current line. A count pastes that many times. |
 374| =J= | Joins the next line (count: that many lines) with one space. |
 375| =~= | Toggles the case of the character under the caret and moves right. |
 376| =r= /x/ | Replaces the character under the caret (count: that many) with /x/; =r RET= splits the line. |
 377| =u=, =C-r= | Undo, redo, with counts. |
 378| =.= | Repeats the last change. |
 379| =ZZ= | Saves the file and closes the window, as =:wq=. |
 380| =ZQ= | Closes the window, as =:q!=. |
 381
 382=o= and =O= open a line below or above with Org's indentation: under a list item, aligned with the item's text; under a heading, none; otherwise the line's own indentation.
 383
 384** Text objects
 385
 386After an operator, or in visual state to select, =i= takes the inner object and =a= the object with its surrounding space or delimiters.
 387
 388| Keys | Object |
 389|-+-|
 390| =iw=, =aw=, =iW=, =aW= | Word, WORD. |
 391| =i"=, =a"=, =i'=, =a'=, =i`=, =a`= | Quoted text on the line. |
 392| =i(=, =a(=, =i)=, =a)=, =ib=, =ab= | Parentheses. |
 393| =i[=, =a[=, =i]=, =a]= | Square brackets. |
 394| =i{=, =a{=, =i}=, =a}=, =iB=, =aB= | Braces. |
 395| =i<=, =a<=, =i>=, =a>= | Angle brackets. |
 396| =ip=, =ap= | Paragraph: lines up to a blank line. |
 397| =ie=, =ae= | Org object at the caret: emphasis, a link, a timestamp, a footnote reference, an entity, a macro and the like (=evil-org-inner-object=, =evil-org-an-object=). =ie= on emphasis takes the text inside the markers, on a link its description. With no object at the caret, the element. |
 398| =iE=, =aE= | Org element: a paragraph, a list, a table, a block, a drawer (=evil-org-inner-element=, =evil-org-an-element=). |
 399| =ir=, =ar= | Org greater element: the list, table, drawer, block or section that contains the element (=evil-org-inner-greater-element=, =evil-org-a-greater-element=). |
 400| =iR=, =aR= | Org subtree: =aR= is the heading and its subtree, =iR= its contents without the heading line (=evil-org-inner-subtree=, =evil-org-a-subtree=). |
 401
 402Tag objects (=it=, =at=) and sentence objects (=is=, =as=) are not available.
 403
 404** Counts and registers
 405
 406A count is digits before a command; =0= only counts after another digit. A register is ="= and a name before the count and command: ="ayy=, ="a3dd=, ="ap=.
 407
 408| Register | Holds |
 409|-+-|
 410| ="a= to ="z= | Named registers. Yanking or deleting into =A= to =Z= appends to the lowercase one. Writing to a named register leaves the clipboard alone. |
 411| ="0= | The last yank. |
 412| =""=, ="+=, ="*= | The system clipboard. This is the unnamed register: every yank, delete and change without a register goes to the clipboard, and =p= without a register pastes from it. |
 413| ="_= | The black hole: deletes without saving the text. |
 414
 415Pasting from the clipboard is linewise when its text is what the last linewise yank or delete put there; text copied in another app pastes as characters. Numbered registers ="1= to ="9=, and the read-only registers such as ="%=, are not available.
 416
 417Registers and macros are shared by every buffer, as in evil: a yank into ="a= in one file pastes with ="ap= in another. Lowercase marks and the jump list belong to the buffer and are gone when it closes. Nothing is kept when Orgstar quits.
 418
 419** Repeat
 420
 421=.= repeats the last change made in normal state, including text typed in insert state that the change began: =ciwfoo ESC= then =.= changes the next word to =foo=. A count before =.= replaces the original count.
 422
 423Changes made from visual or visual-block state, visual =S= surrounds, and keymap commands (such as =M-l= or =SPC m t=) are not repeated by =.=.
 424
 425** Macros
 426
 427| Keys | Does |
 428|-+-|
 429| =q= /a/ | Starts recording keys into macro register /a/ (a letter or digit). The echo area shows =Defining keyboard macro…=. |
 430| =q= | Stops recording: =Keyboard macro defined=. |
 431| =@= /a/ | Plays macro /a/. A count plays it that many times. |
 432| =@@= | Plays the last macro played. |
 433
 434A macro replays the keys you typed, including keymap commands, leader keys and insert-state typing. Keys with =⌘= are not recorded. Macros are kept apart from text registers: ="ap= does not paste a macro, and ="ay= does not change one. Macros can call macros up to 20 deep.
 435
 436** Marks and jumps
 437
 438=m= /a/ sets mark /a/ (any letter) at the caret. Marks move with the text as you edit. ='= /a/ goes to the first non-blank of the mark's line, =`= /a/ to its exact position. =''= and =``= go back to where the last jump started.
 439
 440Jumps are =G=, =gg=, =%=, ={=, =}=, =n=, =N=, =*=, =#=, ='=, =`=, =H=, =M=, =L=, the snipes =s=, =S=, =f=, =F=, =t= and =T=, and searches with =/= and =?=. Each jump adds its starting point to the jump list, which keeps the last 100. =C-o= goes back through the list and =C-i= forward again. A new jump after =C-o= drops the places you went back past.
 441
 442Lowercase marks belong to the buffer, and so do =C-o= and =C-i=. Uppercase marks (=mA= to =mZ=) are file marks, shared by every buffer: ='A= or =`A= in another buffer shows the buffer the mark was set in, at the mark. A file mark goes away when its buffer closes.
 443
 444** Visual states
 445
 446=v= selects characters, =V= whole lines, =C-v= a rectangular block. Motions and text objects extend the selection; =o= moves the caret to the other end. =gv= in normal state selects the last visual selection again.
 447
 448In visual and visual-line state:
 449
 450| Keys | Does |
 451|-+-|
 452| =d=, =x= | Deletes the selection. |
 453| =c= | Deletes it and enters insert state. |
 454| =y= | Yanks it. |
 455| =>=, =<= | Indents or outdents its lines. |
 456| =~=, =u=, =U=, =g~=, =gu=, =gU= | Toggles case, lowercases, uppercases. |
 457| =gc= | Comments or uncomments its lines. |
 458| =gq=, =gw= | Fills the paragraphs in its lines. |
 459| =J= | Joins its lines. |
 460| =p=, =P= | Replaces it with the clipboard or a register; the replaced text goes to the clipboard. |
 461| =S= /x/ | Surrounds it with /x/ (see below). Linewise selections get the delimiters on lines of their own. |
 462| =v=, =V=, =C-v= | Switches to another visual state, or leaves when it is the current one. |
 463| =TAB=, =S-TAB= | Cycles visibility, as in normal state. |
 464
 465The Emacs preset's Org keys (=C-c ...=, =M-h/j/k/l=, =M-<left>= and so on) also work in visual state.
 466
 467In visual-block state:
 468
 469| Keys | Does |
 470|-+-|
 471| Motions, =o=, =O= | Change the block; =o= and =O= move the caret to the opposite corner. |
 472| =$= | Extends every line of the block to its end. |
 473| =d=, =x= | Deletes the block. |
 474| =y= | Yanks the block's lines, joined by newlines. |
 475| =c= | Deletes the block and enters insert state; what you type is copied to every line when you press =ESC=. |
 476| =I=, =A= | Inserts before or after the block on every line. =A= pads short lines with spaces; after =$=, it appends at each line's end. |
 477| =r= /x/ | Replaces every character of the block with /x/. |
 478| =~=, =u=, =U= | Toggles case, lowercases, uppercases the block. |
 479| =>=, =<= | Indents or outdents the block's lines. |
 480| =v=, =V= | Switches to visual or visual-line state. |
 481
 482Block =I=, =A= and =c= copy the typed text to the other lines only when it contains no newline. A yanked block pastes as ordinary lines, not as a block.
 483
 484** Surround
 485
 486As =evil-surround=:
 487
 488| Keys | Does |
 489|-+-|
 490| =ys= /motion/ /x/ | Surrounds the motion's text with /x/: =ys$*= makes the rest of the line bold. Trailing blanks stay outside. |
 491| =ys= =i= /obj/ /x/, =ys= =a= /obj/ /x/ | Surrounds a text object: ~ysiw=~ wraps the word in ~=~ for verbatim. |
 492| =yss= /x/ | Surrounds the line, from its first non-blank. |
 493| =ds= /x/ | Deletes the surrounding /x/. With an opening bracket, the blanks inside go too. |
 494| =cs= /x/ /y/ | Changes the surrounding /x/ to /y/. |
 495| =S= /x/ (visual) | Surrounds the selection. |
 496
 497| /x/ | Delimiters |
 498|-+-|
 499| =(=, =[=, ={=, =<= | The pair with a space inside each: =( text )=. |
 500| =)=, =b= | =(text)= |
 501| =]=, =r= | =[text]= |
 502| =}=, =B= | ={text}= |
 503| =>=, =a= | =<text>= |
 504| =SPC= | A space on each side. |
 505| Any other character | That character on both sides: =*=, =/=, =_=, =+=, ~=~, =~=, ="=, ='=. |
 506
 507For =ds= and =cs=, brackets are found across lines; any other character is matched on the caret's line. Tags (=t=) and functions (=f=) are not supported.
 508
 509** Commenting
 510
 511=gc= with a motion or text object, =gcc= for lines, and =gc= in visual state toggle Org comments. Lines get =#= followed by a space at the shallowest indentation among them; blank lines are left alone. When every non-blank line is already a comment, the comments are removed instead. This is =comment-or-uncomment-region= in Org, as =evilnc-comment-operator= runs it.
 512
 513** Org keys in normal state
 514
 515Besides the leader, the preset binds these evil-org and Doom keys in normal state. =TAB=, =S-TAB= and =RET= in normal state, and the Emacs preset's Org keys in every state, are listed in the [[*Key reference][key reference]]. =gj= and =gk= move by Org element; see [[*Motions][Motions]].
 516
 517| Keys | Command |
 518|-+-|
 519| =TAB= | Cycle Visibility (=org-cycle=). Also in visual state. |
 520| =S-TAB= | Cycle Global Visibility. Also in visual and insert state. |
 521| =RET= | Act at Point (=+org/dwim-at-point=). |
 522| =z a= | Toggle Fold (=+org/toggle-fold=). On a heading line: a folded heading opens one level, showing its body and its child headings folded; an open one folds. |
 523| =z o= | Open Fold (=+org/open-fold=). On a heading line, a folded heading opens one level; an open one stays as it is. |
 524| =z c= | Close Fold (=outline-hide-subtree=). Folds the subtree the caret is in, from anywhere inside it. |
 525| =z A= | Cycle Global Visibility. |
 526| =g h= | Up to Parent Heading. |
 527| =] h=, =[ h= | Next or previous heading at the same level. |
 528| =] b=, =[ b= | Next or previous buffer. |
 529| =M-h=, =M-j=, =M-k=, =M-l= | =M-<left>=, =M-<down>=, =M-<up>=, =M-<right>=: promote, move down, move up, demote on headings; the same for items; move columns and rows in tables. Also in insert and visual state. |
 530| =M-H=, =M-J=, =M-K=, =M-L= | The =M-S-= arrow forms: subtree promote and demote, table row and column insert and delete. Also in insert and visual state. |
 531| =C-S-h=, =C-S-j=, =C-S-k=, =C-S-l= | The =S-= arrow forms: TODO keyword, priority, timestamp and property value changes. Also in insert state. |
 532
 533** The leader
 534
 535=SPC= in normal state is Doom's leader and =SPC m= its local leader for Org. Pause after =SPC= to see the key hints.
 536
 537| Keys | Command |
 538|-+-|
 539| =SPC ,= | Switch to Buffer… (=app.buffer.switch=) |
 540| =SPC .= | Quick Open… (=app.quick-open=) |
 541| =SPC /= | Search Notes (=app.search=) |
 542| =SPC := | Command Palette… (=app.palette=) |
 543| =SPC `= | Last Buffer (=app.buffer.last=) |
 544| =SPC b B= | Switch to Buffer… (=app.buffer.switch=) |
 545| =SPC b K= | Close All Buffers (=app.buffer.kill-all=) |
 546| =SPC b O= | Close Other Buffers (=app.buffer.kill-others=) |
 547| =SPC b S= | Save All Buffers (=app.save-all=) |
 548| =SPC b [= | Previous Buffer (=app.buffer.previous=) |
 549| =SPC b ]= | Next Buffer (=app.buffer.next=) |
 550| =SPC b b= | Switch to Buffer… (=app.buffer.switch=) |
 551| =SPC b d= | Close Buffer (=app.buffer.kill=) |
 552| =SPC b k= | Close Buffer (=app.buffer.kill=) |
 553| =SPC b n= | Next Buffer (=app.buffer.next=) |
 554| =SPC b p= | Previous Buffer (=app.buffer.previous=) |
 555| =SPC b s= | Save (=app.save=) |
 556| =SPC f f= | Quick Open… (=app.quick-open=) |
 557| =SPC f s= | Save (=app.save=) |
 558| =SPC h r r= | Reload Keymap (=app.reload-keymap=) |
 559| =SPC n l= | Store Link (=org.link.store=) |
 560| =SPC o a= | Agenda (=app.agenda=) |
 561| =SPC q q= | Quit Orgstar (=app.quit=) |
 562| =SPC s p= | Search Notes (=app.search=) |
 563| =SPC s s= | Find (=edit.find=) |
 564| =SPC SPC= | Quick Open… (=app.quick-open=) |
 565| =SPC t s= | Check Spelling While Typing (=editor.toggle-spell-check=) |
 566| =SPC t w= | Truncate or Wrap Long Lines (=editor.toggle-truncate-lines=) |
 567| =SPC X= | Capture… (=app.capture=) |
 568| =SPC z t= | Clock Report (=app.clock.report=) |
 569| =SPC m '= | Edit Block (=org.edit-special=) |
 570| =SPC m .= | Go to Heading… (=org.goto=) |
 571| =SPC m A= | Archive Subtree (=app.archive=) |
 572| =SPC m b -= | Insert Table Rule (=org.table.insert-hline=) |
 573| =SPC m b a= | Align Table (=org.table.align=) |
 574| =SPC m b d c= | Delete Table Column (=org.table.delete-column=) |
 575| =SPC m b d r= | Delete Table Row (=org.table.kill-row=) |
 576| =SPC m b i c= | Insert Table Column (=org.table.insert-column=) |
 577| =SPC m b i h= | Insert Table Rule (=org.table.insert-hline=) |
 578| =SPC m b i r= | Insert Table Row (=org.table.insert-row=) |
 579| =SPC m b r= | Recalculate Table (=org.table.recalc-all=) |
 580| =SPC m c E= | Set Effort (=org.effort.set=) |
 581| =SPC m c G= | Go to Recent Clocked Entry… (=app.clock.goto-recent=) |
 582| =SPC m c I= | Clock In to Last Entry (=app.clock.in-last=) |
 583| =SPC m c R= | Clock Report (=app.clock.report=) |
 584| =SPC m c c= | Cancel Clock (=app.clock.cancel=) |
 585| =SPC m c d= | Mark as Default Clock Task (=app.clock.default=) |
 586| =SPC m c g= | Go to Clocked Entry (=app.clock.goto=) |
 587| =SPC m c i= | Clock In (=app.clock.in=) |
 588| =SPC m c o= | Clock Out (=app.clock.out=) |
 589| =SPC m c r= | Resolve Open Clocks… (=app.clock.resolve=) |
 590| =SPC m d T= | Insert Inactive Timestamp (=org.timestamp.inactive=) |
 591| =SPC m d d= | Set Deadline (=org.deadline=) |
 592| =SPC m d s= | Schedule (=org.schedule=) |
 593| =SPC m d t= | Insert Timestamp (=org.timestamp.active=) |
 594| =SPC m e h h= | Export to HTML (=app.export.html=) |
 595| =SPC m e h o= | Export to HTML and Open (=app.export.html-open=) |
 596| =SPC m e l p= | Export to PDF with Emacs (=app.export.pdf=) |
 597| =SPC m e m m= | Export to Markdown (=app.export.markdown=) |
 598| =SPC m h= | Toggle Heading (=org.heading.toggle=) |
 599| =SPC m i= | Toggle Item (=org.item.toggle=) |
 600| =SPC m l i= | Store ID Link (=org.id.store-link=) |
 601| =SPC m l l= | Insert Link… (=org.link.insert=) |
 602| =SPC m l s= | Store Link (=org.link.store=) |
 603| =SPC m o= | Set Property… (=org.property.read-and-set=) |
 604| =SPC m p d= | Lower Priority (=org.priority.down=) |
 605| =SPC m p p= | Set Priority… (=org.priority.set=) |
 606| =SPC m p u= | Raise Priority (=org.priority.up=) |
 607| =SPC m q= | Set Tags (=org.tags.set=) |
 608| =SPC m r r= | Refile… (=app.refile=) |
 609| =SPC m s A= | Archive Subtree (=app.archive=) |
 610| =SPC m s N= | Widen (=org.widen=) |
 611| =SPC m s S= | Sort Entries (=org.sort=) |
 612| =SPC m s a= | Toggle ARCHIVE Tag (=org.archive.toggle-tag=) |
 613| =SPC m s c= | Clone Subtree with Time Shift (=org.subtree.clone=) |
 614| =SPC m s d= | Cut Subtree (=org.subtree.cut=) |
 615| =SPC m s h= | Promote Subtree (=org.subtree.promote=) |
 616| =SPC m s j= | Move Subtree Down (=org.subtree.down=) |
 617| =SPC m s k= | Move Subtree Up (=org.subtree.up=) |
 618| =SPC m s l= | Demote Subtree (=org.subtree.demote=) |
 619| =SPC m s n= | Narrow to Subtree (=org.narrow.subtree=) |
 620| =SPC m s r= | Refile… (=app.refile=) |
 621| =SPC m s s= | Sparse Tree… (=org.sparse-tree=) |
 622| =SPC m t= | Cycle TODO State (=org.todo.cycle=) |
 623| =SPC m x= | Toggle Checkbox (=org.checkbox.toggle=) |
 624
 625** Ex commands
 626
 627=:= opens a prompt in the echo area. Orgstar understands these:
 628
 629| Command | Does |
 630|-+-|
 631| =:w=, =:write= | Saves the file. |
 632| =:q=, =:quit=, =:q!= | Closes the window. Closing the last window quits Orgstar, which asks about unsaved changes as usual. |
 633| =:wq=, =:wq!=, =:x= | Saves, then closes the window. |
 634| =:e= /file/, =:edit= /file/ | Opens /file/, relative to the current file's folder; =~= is expanded. |
 635| =:e=, =:e!=, =:edit=, =:edit!= | Reloads the file from disk; unsaved changes go to the recovery versions. |
 636| =:bn=, =:bnext= | Next buffer. |
 637| =:bp=, =:bprevious=, =:bN=, =:bNext= | Previous buffer. |
 638| =:bd=, =:bdelete=, =:bd!=, =:bw=, =:bwipeout= | Closes the buffer. |
 639| =:b=, =:buffer=, =:ls=, =:buffers=, =:files= | Asks for a buffer to switch to. |
 640| =:= /N/ | Goes to line /N/. |
 641| =:s/= /pattern/ =/= /replacement/ =/= /flags/ | Replaces on the current line. Flags: =g= for every match on the line, =i= to ignore case. =\1= in the replacement is the first group. |
 642| =:%s/= /pattern/ =/= /replacement/ =/= /flags/ | The same on every line. |
 643| =:noh=, =:nohlsearch= | Accepted; does nothing. |
 644
 645Anything else shows =Not an editor command=. Ranges other than =%=, the =c= flag, =:g=, =:normal= and =:set= are not available, and =:= does not work in visual state.
 646
 647** Not available
 648
 649Things evil users may reach for that Orgstar does not have: =zz=, =zt= and the other scroll and fold =z= commands except =za=, =zc=, =zo= and =zA=; =C-a= and =C-x= to increment numbers; =gi=, =g;=, =gJ=; replace state (=R=); =&=; =q:=; the numbered and read-only registers; tag and sentence text objects.
 650
 651* Keys in other windows
 652
 653The block editor, opened by Edit Block (=C-c '=) or Edit Table Field (=C-c `=), is a plain editor with its own two bindings in every preset: =C-c '= or =⌘↩= saves and returns, =Esc= or =C-c C-k= leaves without saving. It does not use the Doom preset's Vim editing or your =keymap.toml=. See [[file:11-code-blocks.org][Code blocks]].
 654
 655The Agenda window has its own keys, modelled on =org-agenda-mode=, which =keymap.toml= does not change:
 656
 657| Key | Does |
 658|-+-|
 659| =n=, =p=, =C-n=, =C-p=, =↓=, =↑= | Next or previous line. |
 660| =RET=, =TAB= | Opens the selected entry, or a calendar event in Calendar. |
 661| =SPC= | Shows the selected entry in the main window, keeping the agenda in front. |
 662| =f=, =b= | Next or previous span (agenda views). |
 663| =.= | Back to today (agenda views). |
 664| =j= | Go to a date (agenda views). |
 665| =v d=, =v w=, =v m= | Day, week or month view (agenda views). |
 666| =d=, =w= | Day or week view (agenda views). |
 667| =k= | Capture an entry scheduled on the selected line's day (agenda views). |
 668| =s= | Save every file. |
 669| =/= | Filter by tags, categories, effort and regexp (=+cat-tag<0:10-/regexp/=). |
 670| =\= | Tag filter (=+tag-tag=). |
 671| ~=~ | Regexp filter (=-re= drops matches). |
 672| =_= | Effort filter (=<0:30=, =>1:00=, ~=1:00~). |
 673| =<= | Filter to the selected entry's category, or clear the category filter. |
 674| \vert{} | Removes every filter. |
 675| =l= | Log mode on or off (agenda views). |
 676| =g=, =r= | Rebuilds the views. |
 677| =t= | Cycle TODO State. |
 678| =+=, =-= | Raise or lower priority. |
 679| =,= | Set priority. |
 680| =:= | Set tags. |
 681| =S-<right>=, =S-<left>= | Moves the entry's timestamp a day later or earlier. |
 682| =I=, =O=, =X= | Clock in, clock out, cancel the clock. |
 683| =$= | Archives the entry. |
 684| =m=, =u=, =U= | Marks, unmarks, unmarks all entries for bulk actions. |
 685| =B= | Bulk action on the marked entries. |
 686| =C-c C-t= | Cycle TODO State. |
 687| =C-c C-s=, =C-c C-d= | Schedule, set deadline. |
 688| =C-c C-q= | Set tags. |
 689| =C-c C-w= | Refile. |
 690| =C-c $=, =C-c C-x C-s= | Archive. |
 691
 692See [[file:07-agenda.org][Agenda]] for what these do. In the Capture window, typing a template's key picks it, =⌘↩= files the entry and =Esc= cancels; see [[file:08-capture.org][Capture]].
 693
 694* iOS and iPadOS
 695
 696With a hardware keyboard, the iOS app runs the Emacs preset's bindings, whatever preset the Mac uses. It does not read =keymap.toml= and has no Vim editing.
 697
 698- Option acts as Meta when the key starts a binding (=M-RET=, =M-<left>=); otherwise Option types characters as usual.
 699- Keys with =⌘= are left to iOS.
 700- Movement and editing keys bound to =edit.= commands (=C-a=, =C-e=, =C-k= and so on) are left to the iOS text system, except undo.
 701- Of the =app.= commands only the clock commands run from keys: =C-c C-x C-i=, =C-c C-x C-o=, =C-c C-x C-q=, =C-c C-x C-j=, =C-c C-x C-x= and =C-c C-x C-z=. Other =app.= keys, and editor commands such as narrowing, show =Not available on iOS yet=.
 702- A sequence of two or more keys whose command cannot run at the caret runs it anyway and shows its message, as on the Mac (for example =Not on a heading=).
 703- A pending prefix shows as a message, without key hints.
 704
 705The on-screen key bar's buttons run what their Emacs keys run at the caret (Fold is =TAB=, Promote is =M-<left>=, TODO is =C-c C-t=). See [[file:14-ios.org][iOS]].
 706
 707* Key reference
 708
 709Every binding in the three presets, generated from the presets themselves. Each command's id, for =keymap.toml=, follows its title.
 710
 711- *Emacs* lists the Emacs preset's keys.
 712- *Mac* lists the Mac preset's keys, with macOS symbols. =⇥= is Tab and =↩= Return.
 713- *Doom* lists the keys the Doom preset adds. Every Emacs-preset key that starts with =C-c= or =C-x=, the =M-= and =S-= arrow keys, =M-RET=, =M-S-RET=, =C-RET=, =M-x= and =M-q= also work in the Doom preset, in normal, insert and visual states, so they are not repeated in the Doom column. Doom keys marked (N), (I) or (V) work only in normal, insert or visual state; unmarked ones work in all three.
 714
 715When a key appears in several rows, it runs the command whose condition holds at the caret: for example =M-<right>= demotes a heading, indents a list item and moves a table column. The descriptions say where each one applies. Movement and text editing in the Doom preset are the Vim keys above, so the Doom column is empty for those rows.
 716
 717** Movement and the region
 718
 719| Command | Emacs | Mac | Doom | What it does |
 720|-+-+-+-+-|
 721| Forward Character (=edit.forward-char=) | =C-f= | — | — | Moves forward one character (=forward-char=). |
 722| Backward Character (=edit.backward-char=) | =C-b= | — | — | Moves back one character (=backward-char=). |
 723| Next Line (=edit.next-line=) | =C-n= | — | — | Moves down one line (=next-line=). |
 724| Previous Line (=edit.previous-line=) | =C-p= | — | — | Moves up one line (=previous-line=). |
 725| Beginning of Line (=edit.beginning-of-line=) | =C-a= | — | — | Moves to the start of the line (=move-beginning-of-line=). |
 726| End of Line (=edit.end-of-line=) | =C-e= | — | — | Moves to the end of the line (=move-end-of-line=). |
 727| Forward Word (=edit.forward-word=) | =M-f= | — | — | Moves forward one word (=forward-word=). |
 728| Backward Word (=edit.backward-word=) | =M-b= | — | — | Moves back one word (=backward-word=). |
 729| Beginning of Buffer (=edit.beginning-of-buffer=) | =M-<= | — | — | Moves to the start of the file (=beginning-of-buffer=). |
 730| End of Buffer (=edit.end-of-buffer=) | =M->= | — | — | Moves to the end of the file (=end-of-buffer=). |
 731| Scroll Up (=edit.scroll-up=) | =C-v= | — | — | Scrolls down one screen (=scroll-up-command=). |
 732| Scroll Down (=edit.scroll-down=) | =M-v= | — | — | Scrolls up one screen (=scroll-down-command=). |
 733| Recenter (=edit.recenter=) | =C-l= | — | — | Scrolls so the caret's line is in the middle of the window (=recenter-top-bottom=, without the cycling). |
 734| Set Mark (=edit.set-mark=) | =C-SPC= | — | — | Sets the mark at the caret. Until the next command that is not a movement, movement keys extend the selection (=set-mark-command=). |
 735| Quit (=edit.keyboard-quit=) | =C-g= | — | — | Drops the mark and the selection, and shows =Quit= (=keyboard-quit=). |
 736| Select All (=edit.select-all=) | =C-x h= | — | — | Selects the whole file (=mark-whole-buffer=). |
 737
 738** Editing
 739
 740| Command | Emacs | Mac | Doom | What it does |
 741|-+-+-+-+-|
 742| Delete Character (=edit.delete-char=) | =C-d= | — | — | Deletes the character after the caret (=delete-char=). |
 743| Kill Word (=edit.kill-word=) | =M-d= | — | — | Deletes to the end of the word (=kill-word=). |
 744| Kill Word Backward (=edit.backward-kill-word=) | =M-DEL= | — | — | Deletes to the start of the word (=backward-kill-word=). |
 745| Kill Line (=edit.kill-line=) | =C-k= | — | — | Deletes to the end of the line, or the newline at its end, into the macOS kill buffer (=kill-line=). |
 746| Kill Region (=edit.kill-region=) | =C-w= | — | — | Cuts the selection to the clipboard (=kill-region=). |
 747| Copy Region (=edit.copy-region=) | =M-w= | — | — | Copies the selection to the clipboard (=kill-ring-save=). |
 748| Yank (=edit.yank=) | =C-y= | — | — | Inserts the text last deleted with Kill Line, from the macOS kill buffer, not the clipboard (=yank=). There is no kill ring. |
 749| Undo (=edit.undo=) | =C-/=, =C-_=, =C-x u= | — | — | Undoes the last change (=undo=). |
 750| Transpose Characters (=edit.transpose-chars=) | =C-t= | — | — | Swaps the characters around the caret (=transpose-chars=). |
 751| Find (=edit.find=) | =C-s=, =C-r= | — | =SPC s s= (N) | Opens the find bar. =C-s= and =C-r= both open it; there is no incremental search (=isearch-forward=). |
 752| Find and Replace (=edit.replace=) | =M-%= | — | — | Opens the find bar with replace (=query-replace=). |
 753| Find Next (=edit.find-next=) | — | — | — | Goes to the next match of the find bar's text. |
 754| Find Previous (=edit.find-previous=) | — | — | — | Goes to the previous match. |
 755| Use Selection for Find (=edit.use-selection-for-find=) | — | — | — | Puts the selection in the find bar. |
 756| Complete at Point (=editor.complete=) | =C-M-i= | — | =C-SPC= (I), =C-@= (I) | Completes what is typed at the caret: =#+= keywords and their values, link types, entities, tags, TODO keywords, headings, drawers, properties, src languages and header arguments, and =<s=-style templates (=completion-at-point=). One candidate is inserted; several open a list. |
 757| Fill Paragraph (=org.fill-paragraph=) | =M-q= | =⌃⌘P= | — | Refills the paragraph or list item to the fill column (=org-fill-paragraph=); with a selection, every paragraph it touches. In the Doom preset, =gq= and =gw= fill the lines a motion covers; see [[*Operators][Operators]]. |
 758
 759** Outline: visibility and narrowing
 760
 761| Command | Emacs | Mac | Doom | What it does |
 762|-+-+-+-+-|
 763| Cycle Visibility (=org.cycle=) | =TAB= | =⇥= | =TAB= (N, V) | On a heading, cycles its subtree through folded, children and everything; on the first or last line of a drawer or block, folds or unfolds it (=org-cycle=). Elsewhere, =TAB= types a tab in the Emacs and Mac presets. |
 764| Toggle Fold (=org.fold.toggle=) | — | — | =z a= (N) | On a heading line, opens a folded heading one level or folds an open one (=+org/toggle-fold=). |
 765| Open Fold (=org.fold.open=) | — | — | =z o= (N) | On a heading line, opens a folded heading one level (=+org/open-fold=). |
 766| Close Fold (=org.fold.close=) | — | — | =z c= (N) | Folds the subtree the caret is in (=outline-hide-subtree=). |
 767| Cycle Global Visibility (=org.cycle-global=) | =S-TAB= | =⇧⇥= | =S-TAB=, =z A= (N) | Cycles the whole file through overview, contents and everything (=org-global-cycle=). |
 768| Narrow to Subtree (=org.narrow.subtree=) | =C-x n s= | — | =SPC m s n= (N) | Shows only the current subtree (=org-narrow-to-subtree=). |
 769| Narrow to Block (=org.narrow.block=) | =C-x n b= | — | — | Shows only the current block (=org-narrow-to-block=). |
 770| Widen (=org.widen=) | =C-x n w= | — | =SPC m s N= (N) | Shows the whole file again (=widen=). |
 771| Narrow to Subtree or Widen (=org.narrow.toggle=) | — | =⌃⌘N= | — | Narrows to the subtree, or widens when already narrowed (=org-toggle-narrow-to-subtree=). |
 772| Sparse Tree… (=org.sparse-tree=) | =C-c /= | — | =SPC m s s= (N) | Asks for a match and shows only the matching entries and their context (=org-sparse-tree=). =C-c C-c= clears the highlights. |
 773| Show or Hide Inline Images (=org.toggle-inline-images=) | =C-c C-x C-v= | — | — | Shows or hides image links as images (=org-toggle-inline-images=). |
 774
 775** Outline: headings and subtrees
 776
 777| Command | Emacs | Mac | Doom | What it does |
 778|-+-+-+-+-|
 779| Next Heading (=org.heading.next=) | =C-c C-n= | =⌥⌘↓= | — | Moves to the next heading (=org-next-visible-heading=). |
 780| Previous Heading (=org.heading.previous=) | =C-c C-p= | =⌥⌘↑= | — | Moves to the previous heading (=org-previous-visible-heading=). |
 781| Next Heading at Same Level (=org.heading.forward-same-level=) | =C-c C-f= | =⌥⇧⌘↓= | =] h= (N) | Moves to the next heading at the same level (=org-forward-heading-same-level=). |
 782| Previous Heading at Same Level (=org.heading.backward-same-level=) | =C-c C-b= | =⌥⇧⌘↑= | =[ h= (N) | Moves to the previous heading at the same level (=org-backward-heading-same-level=). |
 783| Up to Parent Heading (=org.heading.up=) | =C-c C-u= | — | =g h= (N) | Moves to the parent heading (=outline-up-heading=). |
 784| Go to Heading… (=org.goto=) | =C-c C-j= | — | =SPC m .= (N) | Asks for a heading of this file by its outline path and jumps to it (=org-goto=). |
 785| Insert Heading (=org.heading.insert=) | =M-RET= | =⌘↩= | — | Inserts a heading at the current level; on a list item, see Insert Item (=org-meta-return=, =org-insert-heading=). |
 786| Insert Heading After Subtree (=org.heading.insert-after-subtree=) | =C-RET= | =⌃⌘↩= | — | Inserts a heading after the current subtree (=org-insert-heading-respect-content=). |
 787| Insert TODO Heading (=org.heading.insert-todo=) | =M-S-RET= | =⇧⌘↩= | — | Inserts a heading with the first TODO keyword (=org-insert-todo-heading=). |
 788| Promote Heading (=org.heading.promote=) | =M-<left>= | =⌃⌘←= | =M-h=, =C-d= (I), =S-TAB= (I) | On a heading, raises it one level (=org-do-promote=). |
 789| Demote Heading (=org.heading.demote=) | =M-<right>= | =⌃⌘→= | =M-l=, =C-t= (I), =TAB= (I) | On a heading, lowers it one level (=org-do-demote=). |
 790| Promote Subtree (=org.subtree.promote=) | =M-S-<left>= | =⌃⌥⌘←= | =M-H=, =SPC m s h= (N) | On a heading, raises it and its subtree (=org-promote-subtree=). |
 791| Demote Subtree (=org.subtree.demote=) | =M-S-<right>= | =⌃⌥⌘→= | =M-L=, =SPC m s l= (N) | On a heading, lowers it and its subtree (=org-demote-subtree=). |
 792| Move Subtree Up (=org.subtree.up=) | =M-<up>= | =⌃⌥⌘↑= | =M-k=, =SPC m s k= (N) | On a heading, swaps the subtree with the one above (=org-move-subtree-up=). |
 793| Move Subtree Down (=org.subtree.down=) | =M-<down>= | =⌃⌥⌘↓= | =M-j=, =SPC m s j= (N) | On a heading, swaps the subtree with the one below (=org-move-subtree-down=). |
 794| Mark Subtree (=org.subtree.mark=) | =C-c @= | — | — | Selects the current subtree (=org-mark-subtree=). |
 795| Cut Subtree (=org.subtree.cut=) | =C-c C-x C-w= | — | =SPC m s d= (N) | Cuts the subtree to the clipboard (=org-cut-subtree=). |
 796| Copy Subtree (=org.subtree.copy=) | =C-c C-x M-w= | — | — | Copies the subtree to the clipboard (=org-copy-subtree=). |
 797| Paste Subtree (=org.subtree.paste=) | =C-c C-x C-y= | — | — | Pastes a subtree from the clipboard, its levels adjusted to fit (=org-paste-subtree=). |
 798| Clone Subtree with Time Shift (=org.subtree.clone=) | =C-c C-x c= | — | =SPC m s c= (N) | Asks for a count and a time shift, then inserts shifted copies of the subtree (=org-clone-subtree-with-time-shift=). |
 799| Sort Entries (=org.sort=) | =C-c ^= | =⌃⇧⌘S= | =SPC m s S= (N) | Sorts by a key you pick: the lines of a table in a table, the list on an item, otherwise the children of the current heading (=org-sort=). |
 800| Toggle Heading (=org.heading.toggle=) | =C-c *= | — | =SPC m h= (N) | Outside a table, turns headings into text and lines or items into headings (=org-toggle-heading=). |
 801| Toggle COMMENT (=org.heading.toggle-comment=) | =C-c ;= | — | — | Adds or removes the =COMMENT= keyword (=org-toggle-comment=). |
 802| Refile… (=app.refile=) | =C-c C-w= | =⌃⌘W= | =SPC m r r= (N), =SPC m s r= (N) | Asks for a target heading in your folders and moves the subtree there (=org-refile=). |
 803| Archive Subtree (=app.archive=) | =C-c C-x C-s=, =C-c $= | =⌃⌘A= | =SPC m A= (N), =SPC m s A= (N) | Moves the subtree to the archive file (=org-archive-subtree=). |
 804| Toggle ARCHIVE Tag (=org.archive.toggle-tag=) | =C-c C-x a= | — | =SPC m s a= (N) | Adds or removes the =ARCHIVE= tag (=org-toggle-archive-tag=). |
 805| Archive to Archive Sibling (=org.archive.to-sibling=) | =C-c C-x A= | — | — | Moves the subtree under an =Archive= sibling heading (=org-archive-to-archive-sibling=). |
 806
 807** Lists and checkboxes
 808
 809| Command | Emacs | Mac | Doom | What it does |
 810|-+-+-+-+-|
 811| Insert Item (=org.item.insert=) | =M-RET= | =⌘↩= | — | In a list, inserts a new item (=org-insert-item=). |
 812| Insert Checkbox Item (=org.item.insert-checkbox=) | =M-S-RET= | =⇧⌘↩= | — | In a list, inserts a new item with a checkbox. |
 813| Indent Item (=org.item.indent=) | =M-<right>= | =⌃⌘→= | =M-l=, =C-t= (I) | In a list, indents the item (=org-indent-item=). |
 814| Outdent Item (=org.item.outdent=) | =M-<left>= | =⌃⌘←= | =M-h=, =C-d= (I) | In a list, outdents the item (=org-outdent-item=). |
 815| Indent Item and Children (=org.item.indent-tree=) | =M-S-<right>= | =⌃⌥⌘→= | =M-L=, =TAB= (I) | In a list, indents the item and its children (=org-indent-item-tree=). |
 816| Outdent Item and Children (=org.item.outdent-tree=) | =M-S-<left>= | =⌃⌥⌘←= | =M-H=, =S-TAB= (I) | In a list, outdents the item and its children (=org-outdent-item-tree=). |
 817| Move Item Up (=org.item.up=) | =M-<up>= | =⌃⌥⌘↑= | =M-k= | In a list, swaps the item with the one above (=org-move-item-up=). |
 818| Move Item Down (=org.item.down=) | =M-<down>= | =⌃⌥⌘↓= | =M-j= | In a list, swaps the item with the one below (=org-move-item-down=). |
 819| Toggle Checkbox (=org.checkbox.toggle=) | =C-c C-x C-b= | =⌃⌘C= | =SPC m x= (N) | Checks or unchecks the item's checkbox (=org-toggle-checkbox=). |
 820| Toggle Item (=org.item.toggle=) | =C-c -= | — | =SPC m i= (N) | Outside a table: on an item, cycles the list's bullet style; elsewhere turns lines into items and items into text (=org-ctrl-c-minus=). |
 821
 822** TODO, priority and tags
 823
 824| Command | Emacs | Mac | Doom | What it does |
 825|-+-+-+-+-|
 826| Cycle TODO State (=org.todo.cycle=) | =C-c C-t= | =⌃⌘T= | =SPC m t= (N) | Cycles the TODO keyword; with fast-selection keys in =#+TODO=, asks for one (=org-todo=). |
 827| Next TODO Keyword (=org.todo.next=) | =S-<right>= | =⌃⇧⌘→= | =C-S-l= (N, I) | On a heading, sets the next keyword across all sequences (=org-shiftright=). |
 828| Previous TODO Keyword (=org.todo.previous=) | =S-<left>= | =⌃⇧⌘←= | =C-S-h= (N, I) | On a heading, sets the previous keyword (=org-shiftleft=). |
 829| Raise Priority (=org.priority.up=) | =S-<up>= | =⌃⌘↑= | =C-S-k= (N, I), =SPC m p u= (N) | On a heading, raises the priority (=org-priority-up=). |
 830| Lower Priority (=org.priority.down=) | =S-<down>= | =⌃⌘↓= | =C-S-j= (N, I), =SPC m p d= (N) | On a heading, lowers the priority (=org-priority-down=). |
 831| Set Priority… (=org.priority.set=) | =C-c ,= | =⌃⌘,= | =SPC m p p= (N) | Asks for a priority; =SPC= removes it (=org-priority=). |
 832| Set Priority A (=org.priority.set-a=) | — | — | — | Sets priority A. Bound only as a speed key. |
 833| Set Priority B (=org.priority.set-b=) | — | — | — | Sets priority B. Bound only as a speed key. |
 834| Set Priority C (=org.priority.set-c=) | — | — | — | Sets priority C. Bound only as a speed key. |
 835| Remove Priority (=org.priority.remove=) | — | — | — | Removes the priority. Bound only as a speed key. |
 836| Set Tags (=org.tags.set=) | =C-c C-q= | =⌃⌘G= | =SPC m q= (N) | Sets the heading's tags, with fast selection when =#+TAGS= has keys (=org-set-tags-command=). |
 837
 838** Properties and column view
 839
 840| Command | Emacs | Mac | Doom | What it does |
 841|-+-+-+-+-|
 842| Set Property… (=org.property.read-and-set=) | =C-c C-x p= | =⌃⇧⌘P= | =SPC m o= (N) | Asks for a property and a value and sets it (=org-set-property=). |
 843| Next Allowed Value (=org.property.next-value=) | =S-<right>= | =⌃⇧⌘→= | =C-S-l= (N, I) | On a property line, sets the next allowed value (=org-property-next-allowed-value=). |
 844| Previous Allowed Value (=org.property.previous-value=) | =S-<left>= | =⌃⇧⌘←= | =C-S-h= (N, I) | On a property line, sets the previous allowed value (=org-property-previous-allowed-value=). |
 845| Set Effort (=org.effort.set=) | =C-c C-x e= | =⌃⇧⌘E= | =SPC m c E= (N) | Sets the =Effort= property, offering =Effort_ALL= values (=org-set-effort=). |
 846| Column View (=org.columns=) | =C-c C-x C-c= | — | — | Shows the column view of the entries, read-only (=org-columns=). |
 847| Insert Column View Table (=org.columns.insert-dblock=) | =C-c C-x i= | — | — | Inserts a =columnview= dynamic block (=org-columns-insert-dblock=). |
 848| Update Dynamic Block (=org.dblock.update=) | =C-c C-x C-u=, =C-c C-c= | =⌃⌘X= | — | Updates the dynamic block at point, such as a clock table; =C-c C-c= and =⌃⌘X= do it on the block's =#+BEGIN= line (=org-update-dblock=). |
 849
 850** Dates and clocking
 851
 852| Command | Emacs | Mac | Doom | What it does |
 853|-+-+-+-+-|
 854| Insert Timestamp (=org.timestamp.active=) | =C-c .= | =⌃⌘.= | =SPC m d t= (N) | Asks for a date and inserts an active timestamp, or changes the one at point (=org-timestamp=). |
 855| Insert Inactive Timestamp (=org.timestamp.inactive=) | =C-c != | =⌃⌥⌘.= | =SPC m d T= (N) | Same, inactive (=org-timestamp-inactive=). |
 856| Schedule (=org.schedule=) | =C-c C-s= | =⌃⌘S= | =SPC m d s= (N) | Asks for a date and sets =SCHEDULED= (=org-schedule=). |
 857| Set Deadline (=org.deadline=) | =C-c C-d= | =⌃⌘E= | =SPC m d d= (N) | Asks for a date and sets =DEADLINE= (=org-deadline=). |
 858| Increase Timestamp Part (=org.timestamp.up=) | =S-<up>= | =⌃⌘↑= | =C-S-k= (N, I) | On a timestamp, increases the part under the caret: year, month, day, hour or minute (=org-timestamp-up=). |
 859| Decrease Timestamp Part (=org.timestamp.down=) | =S-<down>= | =⌃⌘↓= | =C-S-j= (N, I) | On a timestamp, decreases the part under the caret (=org-timestamp-down=). |
 860| Timestamp One Day Later (=org.timestamp.day-later=) | =S-<right>= | =⌃⌘→= | =C-S-l= (N, I) | On a timestamp, moves it one day later (=org-timestamp-up-day=). |
 861| Timestamp One Day Earlier (=org.timestamp.day-earlier=) | =S-<left>= | =⌃⌘←= | =C-S-h= (N, I) | On a timestamp, moves it one day earlier (=org-timestamp-down-day=). |
 862| Evaluate Time Range (=org.timestamp.evaluate-range=) | =C-c C-y= | — | — | Shows how long the time range lasts, or updates a clock line (=org-evaluate-time-range=). |
 863| Clock In (=app.clock.in=) | =C-c C-x C-i= | =⌃⌘I= | =SPC m c i= (N) | Starts the clock on the current entry (=org-clock-in=). |
 864| Clock In to Recent Entry… (=app.clock.in-recent=) | — | =⌃⌥⌘I= | — | Asks for an entry from the clock history and clocks in to it (=org-clock-in= with =C-u=). |
 865| Clock In to Last Entry (=app.clock.in-last=) | =C-c C-x C-x= | — | =SPC m c I= (N) | Clocks in to the most recently clocked entry (=org-clock-in-last=). |
 866| Clock Out (=app.clock.out=) | =C-c C-x C-o= | =⌃⇧⌘I= | =SPC m c o= (N) | Stops the clock (=org-clock-out=). |
 867| Cancel Clock (=app.clock.cancel=) | =C-c C-x C-q= | =⌃⌘K= | =SPC m c c= (N) | Stops the clock and removes the running clock line (=org-clock-cancel=). |
 868| Go to Clocked Entry (=app.clock.goto=) | =C-c C-x C-j= | =⌃⌘J= | =SPC m c g= (N) | Opens the entry the clock is running on, or the most recently clocked one (=org-clock-goto=). |
 869| Go to Recent Clocked Entry… (=app.clock.goto-recent=) | — | =⌃⌥⌘J= | =SPC m c G= (N) | Asks for an entry from the clock history and opens it (=org-clock-goto= with =C-u=). |
 870| Mark as Default Clock Task (=app.clock.default=) | — | — | =SPC m c d= (N) | Makes the current entry the default task, =d= in the clock selection (=org-clock-mark-default-task=). |
 871| Resolve Open Clocks… (=app.clock.resolve=) | =C-c C-x C-z= | — | =SPC m c r= (N) | Asks what to do with each open =CLOCK:= line in your folders (=org-resolve-clocks=). |
 872| Clock Report (=app.clock.report=) | — | — | =SPC z t= (N), =SPC m c R= (N) | Opens the Clock Report window. |
 873| Insert or Update Clock Table (=org.clock.report=) | =C-c C-x C-r= | — | — | Inserts a clock table, or updates the one at point (=org-clock-report=). |
 874
 875** Tables
 876
 877| Command | Emacs | Mac | Doom | What it does |
 878|-+-+-+-+-|
 879| Create Table (=org.table.create=) | =C-c= \vert{} | =⌃⌘\= | — | Asks for a size and inserts an empty table (=org-table-create=). |
 880| Next Table Field (=org.table.next-field=) | =TAB= | =⇥= | =TAB= (I) | In a table, aligns it and moves to the next field, adding a row at the end (=org-table-next-field=). |
 881| Previous Table Field (=org.table.previous-field=) | =S-TAB= | =⇧⇥= | =S-TAB= (I) | In a table, moves to the previous field (=org-table-previous-field=). |
 882| Next Table Row (=org.table.next-row=) | =RET= | =↩= | =RET= (I) | In a table, moves to the same field in the next row, adding a row at the end (=org-table-next-row=). |
 883| Align Table (=org.table.align=) | — | — | =SPC m b a= (N) | In a table, aligns it (=org-table-align=). =C-c C-c= in a table also aligns it; see Act at Point. |
 884| Move Table Row Up (=org.table.row-up=) | =M-<up>= | =⌃⌘↑= | =M-k= | In a table, moves the row up (=org-table-move-row-up=). |
 885| Move Table Row Down (=org.table.row-down=) | =M-<down>= | =⌃⌘↓= | =M-j= | In a table, moves the row down (=org-table-move-row-down=). |
 886| Move Table Column Left (=org.table.column-left=) | =M-<left>= | =⌃⌘←= | =M-h=, =C-d= (I) | In a table, moves the column left (=org-table-move-column-left=). |
 887| Move Table Column Right (=org.table.column-right=) | =M-<right>= | =⌃⌘→= | =M-l=, =C-t= (I) | In a table, moves the column right (=org-table-move-column-right=). |
 888| Insert Table Column (=org.table.insert-column=) | =M-S-<right>= | =⌃⌥⌘→= | =M-L=, =SPC m b i c= (N) | In a table, inserts a column (=org-table-insert-column=). |
 889| Delete Table Column (=org.table.delete-column=) | =M-S-<left>= | =⌃⌥⌘←= | =M-H=, =SPC m b d c= (N) | In a table, deletes the column (=org-table-delete-column=). |
 890| Insert Table Row (=org.table.insert-row=) | =M-S-<down>= | =⌃⌥⌘↓= | =M-J=, =SPC m b i r= (N) | In a table, inserts a row (=org-table-insert-row=). |
 891| Delete Table Row (=org.table.kill-row=) | =M-S-<up>= | =⌃⌥⌘↑= | =M-K=, =SPC m b d r= (N) | In a table, deletes the row (=org-table-kill-row=). |
 892| Insert Table Rule (=org.table.insert-hline=) | =C-c -= | =⌃⌘-= | =SPC m b -= (N), =SPC m b i h= (N) | In a table, inserts a horizontal rule (=org-table-insert-hline=). |
 893| Recalculate Table Row (=org.table.recalc=) | =C-c *= | =⌃⌘*= | — | In a table, recalculates the current row (=org-table-recalculate=). On a US keyboard, =⌃⌘*= is typed =⌃⇧⌘8=. |
 894| Recalculate Table (=org.table.recalc-all=) | =C-c C-c= | =⌃⌘X= | =SPC m b r= (N) | Recalculates the whole table; =C-c C-c= and =⌃⌘X= run it on a =#+TBLFM= line (=org-table-recalculate= with =C-u=). |
 895| Set Column Formula (=org.table.column-formula=) | ~C-c =~ | — | — | Asks for the column's formula, offering the stored one (=org-table-eval-formula=). |
 896| Edit Table Field (=org.table.edit-field=) | =C-c `= | — | — | In a table, edits the field in a separate editor (=org-table-edit-field=). |
 897| Shrink or Expand Table Column (=org.table.toggle-column-width=) | =C-c TAB= | — | — | In a table, shrinks or expands the column (=org-table-toggle-column-width=). |
 898
 899** Links and footnotes
 900
 901| Command | Emacs | Mac | Doom | What it does |
 902|-+-+-+-+-|
 903| Open Link (=org.link.open=) | =C-c C-o= | =⌃⌘O= | — | Follows the link or timestamp at the caret (=org-open-at-point=). |
 904| Insert Link… (=org.link.insert=) | =C-c C-l= | =⌘K= | =SPC m l l= (N) | Asks for a link and description and inserts it, offering stored links (=org-insert-link=). |
 905| Store Link (=org.link.store=) | =C-c l= | =⌃⌘L= | =SPC m l s= (N), =SPC n l= (N) | Stores a link to the current entry for a later Insert Link (=org-store-link=). |
 906| Store ID Link (=org.id.store-link=) | — | — | =SPC m l i= (N) | Gives the entry an =ID= if needed and stores an =id:= link to it (=org-id-store-link=). |
 907| Footnote Action (=org.footnote.action=) | =C-c C-x f= | =⌃⇧⌘F= | — | On a reference, goes to its definition; on a definition, back to a reference; elsewhere inserts a footnote (=org-footnote-action=). |
 908
 909** Code blocks and C-c C-c
 910
 911| Command | Emacs | Mac | Doom | What it does |
 912|-+-+-+-+-|
 913| Act at Point (C-c C-c) (=org.ctrl-c-ctrl-c=) | =C-c C-c= | =⌃⌘X= | — | Does what fits the context: sets tags on a heading, toggles an item's checkbox, follows a footnote, offers the property menu in a property drawer, updates a clock line, statistics cookie or timestamp, runs a =#+CALL:= line, inline =call_= or inline =src_= block, and refreshes the setup on a =#+= keyword line (=org-ctrl-c-ctrl-c=). In a table it evaluates a formula typed in the field (starting with ~=~ or ~:=~), then recalculates the row when it is marked =#= and otherwise aligns the table; at the table's first character it recalculates the whole table. After a sparse tree, the first =C-c C-c= only clears the highlights. More specific bindings take =C-c C-c= and =⌃⌘X= in src blocks, =#+TBLFM= lines and dynamic blocks. |
 914| Act at Point (=org.dwim=) | — | — | =RET= (N) | Doom's =+org/dwim-at-point=: follows a link, runs a src block, recalculates or aligns a table, toggles a checkbox, or switches a heading between TODO and done. |
 915| Run Source Block (=org.babel.execute=) | =C-c C-c= | =⌃⌘X= | — | In a src block, runs it and inserts the results (=org-babel-execute-src-block=). |
 916| Tangle File (=org.babel.tangle=) | =C-c C-v t=, =C-c C-v C-t= | =⌃⌘V= | — | Writes the file's src blocks to their tangle targets (=org-babel-tangle=). |
 917| Tangle Block (=org.babel.tangle-block=) | — | =⌃⇧⌘V= | — | Tangles only the src block at point (=org-babel-tangle= with =C-u=). |
 918| Tangle Block's Target (=org.babel.tangle-target=) | — | =⌃⌥⌘V= | — | Tangles every block that writes to the same file as the block at point (=org-babel-tangle= with =C-u C-u=). |
 919| Insert Structure Template (=org.structure-template=) | =C-c C-,= | — | — | Asks for a block type and inserts the block, or wraps the selection (=org-insert-structure-template=). |
 920| Edit Block (=org.edit-special=) | =C-c '= | =⌃⌘'= | =SPC m '= (N) | Edits the src, example or export block at point in a separate editor (=org-edit-special=). |
 921
 922** Agenda and capture
 923
 924| Command | Emacs | Mac | Doom | What it does |
 925|-+-+-+-+-|
 926| Agenda (=app.agenda=) | =C-c a= | — | =SPC o a= (N) | Opens the Agenda window (=org-agenda=). |
 927| Capture… (=app.capture=) | =C-c c= | — | =SPC X= (N) | Opens the Capture window (=org-capture=). |
 928
 929** Export
 930
 931| Command | Emacs | Mac | Doom | What it does |
 932|-+-+-+-+-|
 933| Export… (=app.export-dialog=) | — | =⇧⌘E= | — | Opens the export sheet. In the Emacs and Doom presets =C-c C-e= is a prefix for the export keys only; pausing after it lists them in the key hints. |
 934| Export to HTML (=app.export.html=) | =C-c C-e h h= | — | =SPC m e h h= (N) | Exports to HTML (=org-html-export-to-html=). |
 935| Export to HTML and Open (=app.export.html-open=) | =C-c C-e h o= | — | =SPC m e h o= (N) | Exports to HTML and opens the result. |
 936| Export to Markdown (=app.export.markdown=) | =C-c C-e m m= | — | =SPC m e m m= (N) | Exports to Markdown (=org-md-export-to-markdown=). |
 937| Export to PDF with Emacs (=app.export.pdf=) | =C-c C-e l p= | — | =SPC m e l p= (N) | Exports to PDF through Emacs (=org-latex-export-to-pdf=). |
 938| Export to LaTeX with Emacs (=app.export.latex=) | =C-c C-e l l= | — | — | Exports to LaTeX through Emacs (=org-latex-export-to-latex=). |
 939| Export to ODT with Emacs (=app.export.odt=) | =C-c C-e o o= | — | — | Exports to ODT through Emacs (=org-odt-export-to-odt=). |
 940| Export to Plain Text with Emacs (=app.export.text=) | =C-c C-e t u= | — | — | Exports to plain text through Emacs (=org-ascii-export-to-ascii=). |
 941
 942** Files, buffers and the app
 943
 944| Command | Emacs | Mac | Doom | What it does |
 945|-+-+-+-+-|
 946| Save (=app.save=) | =C-x C-s= | — | =SPC f s= (N), =SPC b s= (N) | Saves the file (=save-buffer=). |
 947| Save All Buffers (=app.save-all=) | =C-x s= | — | =SPC b S= (N) | Saves every open buffer (=save-some-buffers=). |
 948| Quick Open… (=app.quick-open=) | =C-x C-f= | — | =SPC SPC= (N), =SPC .= (N), =SPC f f= (N) | Opens a file of your folders by name (=find-file=). |
 949| Switch to Buffer… (=app.buffer.switch=) | =C-x b=, =C-x C-b= | — | =SPC b b= (N), =SPC b B= (N), =SPC ,= (N) | Asks for an open buffer and shows it (=switch-to-buffer=). |
 950| Next Buffer (=app.buffer.next=) | =C-x <right>= | =⌃⇥= | =SPC b n= (N), =SPC b ]= (N), =] b= (N) | Shows the next open buffer (=next-buffer=). |
 951| Previous Buffer (=app.buffer.previous=) | =C-x <left>= | =⌃⇧⇥= | =SPC b p= (N), =SPC b [= (N), =[ b= (N) | Shows the previous open buffer (=previous-buffer=). |
 952| Last Buffer (=app.buffer.last=) | — | — | =SPC `= (N) | Shows the buffer you were in before this one. |
 953| Close Buffer (=app.buffer.kill=) | =C-x k= | — | =SPC b k= (N), =SPC b d= (N) | Closes the buffer, asking about unsaved changes in explicit save mode (=kill-buffer=). |
 954| Close Other Buffers (=app.buffer.kill-others=) | — | — | =SPC b O= (N) | Closes every other buffer. |
 955| Close All Buffers (=app.buffer.kill-all=) | — | — | =SPC b K= (N) | Closes every buffer. |
 956| Command Palette… (=app.palette=) | =M-x= | — | =SPC := (N) | Opens the command palette (=execute-extended-command=). |
 957| Search Notes (=app.search=) | — | — | =SPC /= (N), =SPC s p= (N) | Moves to the search field for searching your notes. |
 958| Reload Keymap (=app.reload-keymap=) | — | — | =SPC h r r= (N) | Reads =keymap.toml= again. |
 959| Check Spelling While Typing (=editor.toggle-spell-check=) | — | — | =SPC t s= (N) | Turns spell checking while typing on or off. |
 960| Truncate or Wrap Long Lines (=editor.toggle-truncate-lines=) | =C-x x t= | — | =SPC t w= (N) | Switches between wrapping and truncating long lines (=toggle-truncate-lines=). |
 961| Quit Orgstar (=app.quit=) | — | — | =SPC q q= (N) | Quits Orgstar (=save-buffers-kill-terminal=). |
 962
 963** Unbound commands
 964
 965No preset binds these. Run them from the palette or a menu, or bind them in =keymap.toml=.
 966
 967| Command | What it does |
 968|-+-|
 969| Board (=app.board=) | Opens the Board window. Window ▸ Board, =⇧⌘B=. |
 970| Cancel Running Task (=app.babel.cancel=) | Stops the src block that is running, or an export or table recalculation running in Emacs. Edit ▸ Cancel Running Task, =⌘.=. |
 971| Edit Config File (=app.edit-config=) | Opens =config.toml= in the editor. =⌥⌘,=. |
 972| Import from Emacs… (=app.import-emacs=) | Opens Import from Emacs…. |
 973| Revert to File on Disk (=app.revert=) | Replaces the buffer with the file on disk; unsaved changes go to recovery (=revert-buffer=). |
 974| Recovery Versions… (=app.recovery=) | Shows the recovery versions of the file. |
 975| Resolve Sync Conflicts… (=app.sync-conflicts=) | Shows the file's sync conflict copies to resolve them. |
 976| Import Table from File… (=app.table-import=) | Asks for a CSV, TSV or space-separated file and inserts it as a table (=org-table-import=). |
 977| Export Table to File… (=app.table-export=) | Writes the table at point to a CSV or TSV file (=org-table-export=). |
 978| Show or Hide Outline (=app.toggle-outline=) | Shows or hides the outline pane. View ▸ Show or Hide Outline, =⌥⌘O=. |
 979| Show or Hide Backlinks (=app.toggle-backlinks=) | Shows or hides the backlinks pane. View ▸ Show or Hide Backlinks. |
 980| Show or Hide Columns and Clock (=app.toggle-inspector=) | Shows or hides the columns and clock inspector. View ▸ Show or Hide Columns and Clock, =⌥⌘I=. |
 981| Show or Hide Markup (=app.toggle-markup=) | Shows or hides link brackets and emphasis markers. View ▸ Show Markup, =⇧⌘M=. |
 982| Show or Hide Line Numbers (=app.toggle-line-numbers=) | Shows or hides line numbers. View ▸ Show Line Numbers, =⇧⌘L=. |
 983| Show or Hide Tab Bar (=app.toggle-tab-bar=) | Shows or hides the tab bar. View ▸ Show Tab Bar. |
 984| Column View of File (=org.columns.global=) | Shows the column view of the whole file (=org-columns= with =C-u=). |
 985| Remove Schedule (=org.schedule.remove=) | Removes =SCHEDULED= (=org-schedule= with =C-u=). |
 986| Remove Deadline (=org.deadline.remove=) | Removes =DEADLINE= (=org-deadline= with =C-u=). |
 987| Create ID (=org.id.create=) | Gives the entry an =ID= property, a lowercase UUID, unless it has one (=org-id-get-create=). |
 988| Delete Property… (=org.property.delete=) | Asks for a property of the entry and deletes it (=org-delete-property=). |
 989| Delete Property Everywhere… (=org.property.delete-globally=) | Asks for a property and deletes it from every entry in the file (=org-delete-property-globally=). |
 990| Property Action… (=org.property.action=) | Offers set, delete and delete globally for the property at point (=org-property-action=). =C-c C-c= in a property drawer runs it. |
 991| Footnote Menu (=org.footnote.menu=) | Offers the footnote commands as a menu (=org-footnote-action= with =C-u=). |
 992| Set Field Formula (=org.table.field-formula=) | Asks for the current field's formula (=org-table-eval-formula= with =C-u=). |
 993| Sort Table Lines (=org.table.sort=) | Asks for alphabetic, numeric or time order, or their reverse, and sorts the table's lines by the current column (=org-table-sort-lines=). Sort Entries does the same in a table. |
 994| Transpose Table (=org.table.transpose=) | Swaps the table's rows and columns (=org-table-transpose-table-at-point=). |
 995| Shrink Table Columns with Widths (=org.table.shrink=) | Shrinks the table's columns that have a width cookie (=org-table-shrink=). |
 996| Expand Table Columns (=org.table.expand=) | Expands the table's shrunk columns (=org-table-expand=). |
 997
 998** Speed keys reference
 999
1000At the very start of a heading line, with =org-use-speed-commands= on. The same in every preset (Doom: insert state).
1001
1002| Key | Command |
1003|-+-|
1004| =n= | Next Heading (=org.heading.next=) |
1005| =p= | Previous Heading (=org.heading.previous=) |
1006| =f= | Next Heading at Same Level (=org.heading.forward-same-level=) |
1007| =b= | Previous Heading at Same Level (=org.heading.backward-same-level=) |
1008| =u= | Up to Parent Heading (=org.heading.up=) |
1009| =j= | Go to Heading… (=org.goto=) |
1010| =c= | Cycle Visibility (=org.cycle=) |
1011| =C= | Cycle Global Visibility (=org.cycle-global=) |
1012| =s= | Narrow to Subtree or Widen (=org.narrow.toggle=) |
1013| =k= | Cut Subtree (=org.subtree.cut=) |
1014| =U= | Move Subtree Up (=org.subtree.up=) |
1015| =D= | Move Subtree Down (=org.subtree.down=) |
1016| =r= | Demote Heading (=org.heading.demote=) |
1017| =l= | Promote Heading (=org.heading.promote=) |
1018| =R= | Demote Subtree (=org.subtree.demote=) |
1019| =L= | Promote Subtree (=org.subtree.promote=) |
1020| =i= | Insert Heading After Subtree (=org.heading.insert-after-subtree=) |
1021| =^= | Sort Entries (=org.sort=) |
1022| =w= | Refile… (=app.refile=) |
1023| =a= | Archive Subtree (=app.archive=) |
1024| =@= | Mark Subtree (=org.subtree.mark=) |
1025| =#= | Toggle COMMENT (=org.heading.toggle-comment=) |
1026| =I= | Clock In (=app.clock.in=) |
1027| =O= | Clock Out (=app.clock.out=) |
1028| =t= | Cycle TODO State (=org.todo.cycle=) |
1029| =,= | Set Priority… (=org.priority.set=) |
1030| =0= | Remove Priority (=org.priority.remove=) |
1031| =1= | Set Priority A (=org.priority.set-a=) |
1032| =2= | Set Priority B (=org.priority.set-b=) |
1033| =3= | Set Priority C (=org.priority.set-c=) |
1034| =:= | Set Tags (=org.tags.set=) |
1035| =e= | Set Effort (=org.effort.set=) |
1036| =v= | Agenda (=app.agenda=) |
1037| =/= | Sparse Tree… (=org.sparse-tree=) |
1038| =o= | Open Link (=org.link.open=) |