docs/manual/guide/02-the-editor.org

8714ee09211f42f94ac2c75672f19c309b84860b
orgstar/docs/manual/guide/02-the-editor.org

400 lines · 39338 bytes

  1#+TITLE: The editor
  2#+DESCRIPTION: How the editor displays org text, folds it, reports state in the modeline and echo area, completes, checks spelling, pairs brackets, wraps lines and undoes.
  3#+LEDE: The editor shows an org file as plain text with its markup styled or hidden, folds headings, drawers and blocks the way Org does, and reports position and state in a modeline and echo area below the text.
  4
  5* What the editor shows
  6
  7The editor holds the file's text exactly as it is on disk. Styling, hidden markup, indentation and images are display only; none of them change the file.
  8
  9Org files open with the caret at the start of the file, as in Emacs. Buffers you had open when you quit reopen with the caret where you left it.
 10
 11** Markup
 12
 13View ▸ Show Markup (=⇧⌘M=; palette: Show or Hide Markup) is off by default. While it is off:
 14
 15- Link brackets and targets are hidden, so =[[https://orgmode.org][Org]]= shows as an underlined =Org=, as with =org-link-descriptive=.
 16- Emphasis markers (the =*= of bold, the === of verbatim and so on) are hidden when =org-hide-emphasis-markers= is on, which is the default.
 17- Entities and sub- and superscripts are drawn as characters when =org-pretty-entities= is on, which is the default (see /Entities/ below).
 18
 19The line with the caret always shows its markup, so you can edit it. Moving to another line hides it again. Turn Show Markup on to see all markup everywhere. The =config.toml= setting is =show-markup= in =[orgstar]=.
 20
 21The two Org options are in Settings ▸ Editing as "Emacs hides emphasis markers" and "Emacs shows entities as characters", and in =config.toml= as =org-hide-emphasis-markers= and =org-pretty-entities=. They also tell orgstar how wide your Emacs displays text, so tag alignment, table alignment and =M-q= produce the same file Emacs would. Set them to match your Emacs.
 22
 23** Styling
 24
 25- Headings are bold and coloured by level (eight colours, as =org-level-1= to =org-level-8=). Levels 1 to 3 are larger than body text: each level is a step larger than the one below it, and level 4 and deeper are body size. The step is Settings ▸ Appearance ▸ "Headings grow by N pt a level" (1 pt by default, 0 to 8).
 26- TODO and DONE keywords are bold, in the TODO or DONE colour, or a colour you set for that keyword.
 27- Priorities, tags, timestamps, comments, keywords (=#+TITLE:= and the like), planning lines and drawers, block delimiters and tables each have a colour; footnotes, targets, macros and LaTeX share one.
 28- Bold, italic, underline and strike-through are drawn as such; verbatim and code get their own colour and background.
 29- Links are underlined.
 30- Blocks (=#+BEGIN_…= to =#+END_…=), dynamic blocks and fixed-width lines are drawn on a shaded band across the whole width of the editor, as Emacs extends the =org-block= face. Code in src blocks is highlighted for its language (see [[file:11-code-blocks.org][Code blocks]]).
 31- A folded heading shows an ellipsis after its line.
 32
 33Colours come from the theme and follow the system's light or dark appearance. The font, size, line spacing and text width are in Settings ▸ Appearance; colours are set in =config.toml=. See [[file:13-configuration.org][Configuration]]. The font should be monospaced, since tags and tables line up by columns. A body font for prose can be set beside it, as =mixed-pitch-mode= does in Emacs: prose and headings use it, and tables, code, dates, tags, drawers and the start of each line keep the monospaced font.
 34
 35** Adding emphasis
 36
 37Emphasize… (=C-c C-x C-f= in the Emacs and Doom presets, =org-emphasize=) asks for a marker: =*= bold, =/= italic, =_= underline, === verbatim, =~= code, =+= strike-through, or =SPC= to remove emphasis. With a selection it wraps the selection in the marker, replacing one the selection already has. Without one it inserts a pair of markers with the caret between them. A space goes before or after the markers where the text next to them couldn't border emphasis, as Org adds it.
 38
 39The Mac preset binds =⌘B=, =⌘I= and =⌘U= to bold, italic and underline. Each marker is also a command of its own in the palette (Bold, Italic, Underline, Verbatim, Code, Strike-Through), for binding in =keymap.toml=; see [[file:03-keys.org][Keys and commands]]. On iOS the key bar has Bold, Italic and Code.
 40
 41** Indentation and stars
 42
 43Org files display as =org-indent-mode= shows them, by default: each heading's body is indented to start one column past its stars, all stars but the last are hidden, and a wrapped heading title continues under the title. The indentation is display only; the file keeps its text at the left margin.
 44
 45Body lines that wrap continue under their own text: past leading spaces, and past a list item's bullet and checkbox, as =adaptive-wrap= does.
 46
 47| Setting                                 | Default | What it does                                                         |
 48|-----------------------------------------+---------+----------------------------------------------------------------------|
 49| =org-startup-indented=                  | on      | Indent bodies under their headings. =#+STARTUP: indent= or =noindent= overrides it per file. |
 50| =org-hide-leading-stars=                | off     | Without indentation, show only a heading's last star. =#+STARTUP: hidestars= or =showstars= overrides it. |
 51
 52With both off, headings show all their stars and bodies start at the left margin. Both settings are in =config.toml= only, and are read when a file opens.
 53
 54** Entities
 55
 56When =org-pretty-entities= is on and Show Markup is off:
 57
 58- An entity such as =\alpha= or =\to= is drawn as its character (=α=, =→=), taking one column.
 59- =x_{1}= and =x^{2}= are drawn lowered and raised, without their markers. Braces are required: =x_1= is left as typed.
 60
 61Entities are left as typed on the caret's line, in comment lines and inside blocks. Sub- and superscripts are left as typed inside emphasis, links and keywords.
 62
 63** Inline images
 64
 65Org ▸ Show or Hide Inline Images (=C-c C-x C-v= in the Emacs and Doom presets), as =org-toggle-inline-images= does, draws images in place of their links. The echo area reports how many images it displayed.
 66
 67A =file:= or =attachment:= link to an image file shows as its image wherever the link is: on a line of its own, or in the text of a paragraph, a heading, a list item or a table:
 68
 69#+BEGIN_SRC org
 70#+ATTR_ORG: :width 400
 71[[file:images/diagram.png]]
 72
 73The plot [[file:images/plot.png]] and the photo file:images/photo.jpg share a line.
 74
 75| Before | [[file:before.png]] |
 76| After  | [[file:after.png]]  |
 77#+END_SRC
 78
 79- Recognised extensions: =png=, =jpg=, =jpeg=, =gif=, =svg=, =webp=, =tif=, =tiff=, =bmp=, =heic=, =avif=.
 80- Paths are relative to the file's folder; =~= is expanded. Images at http(s) links show when =org-display-remote-inline-images= is =download= or =cache=; see [[file:09-links.org::*Remote images][Remote images]].
 81- =attachment:= links, such as =[[attachment:photo.jpg]]=, show the file from the entry's attachment folder, found as following the link finds it: the =DIR= property, else the =ID= folder under =org-attach-id-dir=. See [[file:04-outlines.org][Outlines]] for attachments.
 82- A link with a description shows as a link, unless the description is itself one =file:= or =attachment:= link to an image, plain or in angle brackets: =[[https://example.com][file:thumbnail.png]]= shows =thumbnail.png=. Show or Hide Inline Images, Including Described Links (=C-u C-c C-x C-v= in the Emacs preset, and in the command palette), as =org-toggle-inline-images= with a prefix argument does, also shows the image a described link points to, such as =[[file:plot.png][the plot]]=; the link's path then decides, not its description.
 83- Links in verbatim and code text, comments, keyword lines, and source and example blocks stay text.
 84- =#+ATTR_ORG: :width N= above a paragraph sets the width in points of each image in it. Images are never wider than the editor.
 85- A link that is all its line holds shows its image on that line. An image in a line's text stands where its link is, and its line is as tall as the image.
 86- The link text is hidden while its image shows, except on the caret's line. There the image is drawn under the link, or under the paragraph for an image in a line's text.
 87
 88To show images when a file opens, add =#+STARTUP: inlineimages= to the file, or set =org-startup-with-inline-images = true= in =config.toml=. =#+STARTUP: noinlineimages= turns it off for one file. Images shown when a file opens leave described links as links, as in Org.
 89
 90** LaTeX previews
 91
 92Show or Hide LaTeX Previews (=C-c C-x C-l= in the Emacs and Doom presets, and in the command palette) draws LaTeX fragments and environments as typeset math, as =org-latex-preview= does. The echo area reports how many fragments it previewed.
 93
 94#+BEGIN_SRC org
 95The area is $\pi r^2$, and \(\sqrt{2}\) is irrational.
 96\begin{equation}
 97\int_0^1 x\,dx = \frac{1}{2}
 98\end{equation}
 99#+END_SRC
100
101- =$…$= and =\(…\)= are typeset as inline math, =$$…$$=, =\[…\]= and environments as display math. =equation=, =align=, =gather= and their starred forms are typeset as their bodies, aligned or gathered.
102- The math is typeset by orgstar itself, with the Latin Modern Math font, in the editor's text color and size; it needs no TeX installation and works on iOS. It reads the math commands LaTeX's =amsmath= has for formulas, not packages a file loads with =#+LATEX_HEADER=. A fragment it can't read stays as text.
103- The caret's line shows the source, so you can edit it.
104- Fragments in source and example blocks aren't previewed.
105
106The command switches previews for the whole buffer; Org's =C-u= forms, which act on the section at point, aren't there. To preview when a file opens, add =#+STARTUP: latexpreview= to the file, or set =org-startup-with-latex-preview = true= in =config.toml=. =#+STARTUP: nolatexpreview= turns it off for one file. After switching between light and dark appearance, switch previews off and on to redraw them in the new color.
107
108* Folding
109
110Headings, drawers and blocks fold as in Org. Folding is display only and isn't saved in the file.
111
112** Cycling
113
114| Action                         | Emacs and Mac presets | Doom                                                 | Org command          |
115|--------------------------------+-----------------------+------------------------------------------------------+----------------------|
116| Cycle the heading or element at the caret | =TAB=      | =TAB= in normal and visual state                     | =org-cycle=          |
117| Cycle the whole file           | =S-TAB=               | =S-TAB=, =z A= in normal state; =S-TAB= in visual state | =org-global-cycle=   |
118| Open or fold the heading       |                       | =z a= in normal state                                | =+org/toggle-fold=   |
119| Open the heading one level     |                       | =z o= in normal state                                | =+org/open-fold=     |
120| Fold the subtree the caret is in |                     | =z c= in normal state                                | =outline-hide-subtree= |
121
122The titles in the palette and the Org menu are Cycle Visibility, Cycle Global Visibility, Toggle Fold, Open Fold and Close Fold.
123
124Toggle Fold and Open Fold act on a heading line: a folded heading opens one level, showing its body and its child headings, each folded. On an open heading, Toggle Fold folds it and Open Fold does nothing. Close Fold folds the subtree of the heading the caret is under, from anywhere in it.
125
126=TAB= on a heading line cycles that heading: folded, then its children, then the whole subtree, then folded again. A heading without children goes straight from folded to open. =TAB= on the first or last line of a drawer or block folds or opens it; drawer and block folds are kept apart from heading folds, so cycling a heading leaves them as they are. Elsewhere =TAB= does what it otherwise would: in a table it moves to the next field, and in plain text it inserts a tab.
127
128In Doom's insert state, =TAB= and =S-TAB= on a heading demote and promote it, and on a list item indent and outdent it, as Doom's =+org-indent-maybe-h= does. Use normal state to fold.
129
130=S-TAB= cycles the whole file through three states, starting at the first:
131
1321. Overview: top-level headings only.
1332. Contents: every heading, no bodies.
1343. Show all: everything, with blocks opened. Drawers stay folded.
135
136Overview and contents also fold drawers before the first heading.
137
138Clicking a heading's stars cycles that heading, as =TAB= does on it.
139
140The caret can't rest in folded text: moving forward into a fold jumps past it, and moving back into one goes to the end of the heading line. Going to a location from the outline pane, search, a link or the agenda opens whatever folds hide it.
141
142** Folding when a file opens
143
144With no =#+STARTUP= visibility option, a file opens with every heading shown. Drawers start folded (=org-cycle-hide-drawer-startup=, on by default); blocks start open (=org-cycle-hide-block-startup=, off by default). Both settings are in =config.toml=.
145
146=#+STARTUP= options a file can set:
147
148| Option                                 | Effect when the file opens                                  |
149|----------------------------------------+-------------------------------------------------------------|
150| =overview=, =fold=                     | Top-level headings only                                     |
151| =content=                              | Every heading, no bodies                                    |
152| =showall=, =nofold=                    | Everything                                                  |
153| =show2levels=, =show3levels=, …        | Headings down to that level, no bodies                      |
154| =showeverything=                       | Everything, including drawers and blocks; =VISIBILITY= properties are ignored |
155| =hidedrawers=, =nohidedrawers=         | Fold or open drawers                                        |
156| =hideblocks=, =nohideblocks=           | Fold or open blocks                                         |
157| =indent=, =noindent=                   | Indent bodies under headings, or not                        |
158| =hidestars=, =showstars=               | Hide all stars but the last, or not                         |
159| =inlineimages=, =noinlineimages=       | Show image links as images, or not                          |
160| =latexpreview=, =nolatexpreview=       | Show LaTeX fragments as typeset math, or not                |
161| =align=, =noalign=                     | Align every table, or not (=org-startup-align-all-tables=)  |
162| =shrink=                               | Narrow table columns that have width cookies                |
163
164#+BEGIN_SRC org
165#+STARTUP: content hideblocks
166#+END_SRC
167
168When the file sets a visibility (=overview=, =content=, =showall=, =showNlevels= and the like, but not =showeverything=), orgstar then applies each heading's =VISIBILITY= property and folds subtrees tagged =ARCHIVE=, as =org-cycle-set-visibility-according-to-property= and =org-cycle-hide-archived-subtrees= do. =VISIBILITY= takes =folded=, =children=, =content= or =all=:
169
170#+BEGIN_SRC org
171,* Reference
172:PROPERTIES:
173:VISIBILITY: folded
174:END:
175#+END_SRC
176
177=#+STARTUP= options are read from the file and from any =#+SETUPFILE= it names, and take effect when the file opens. To apply changed options to an open file, close its buffer and open it again.
178
179Narrowing to a subtree or block, and sparse trees, also hide text; see [[file:04-outlines.org][Outlines]].
180
181* Panes and windows
182
183A window can show more than one buffer at once, or one buffer in more than one place, as Emacs windows do. Split Pane Below (=C-x 2=) and Split Pane Right (=C-x 3=) divide the pane with the focus in two; the new pane shows the same buffer, and the focus stays where it was. Drag the line between two panes to resize them. Close Pane (=C-x 0=) removes the focused pane, Close Other Panes (=C-x 1=) leaves only it, and Next Pane (=C-x o=) moves the focus through the panes in reading order. With several panes, a bar along the top marks the one with the focus. The sidebar, the outline and the title follow the focused pane. In the Doom preset these are =SPC w s=, =SPC w v=, =SPC w d=, =SPC w o= and =SPC w w=, and =C-w= with the same letters in normal state; the Mac preset and the View menu use =⌃⌘2=, =⌃⌘3=, =⌃⌘0=, =⌃⌘1= and =⌥⌘`=.
184
185Each pane has its own caret, selection and scroll position, and its own tabs (see [[file:01-files-and-folders.org][Files and folders]]): the buffers it has shown. Everything else about a buffer is the buffer's, as in Emacs: its text and undo, its folds, narrowing and sparse tree, its evil state and mark, shrunk table columns and inline images. Two panes on one buffer therefore show the same folds, and a fold made in one shows in the other. Closing a pane leaves its buffers open; closing a buffer (=C-x k=) takes it out of every pane, which falls back to the buffer it showed before.
186
187New Window (=C-x 5 2=, =⌥⌘N=, File ▸ New Window) opens a window of panes alone, without the sidebar or search, on the buffer the focused pane shows, as a second Emacs frame. Commands act on the pane with the focus whichever window it is in; Quick Open, the palette and search open from the main window and show their result in the focused pane. Closing the window closes its panes and leaves the buffers open.
188
189* The modeline
190
191The line under the editor shows, from the left:
192
193| Item                       | Shown when                         | What it shows                                                     |
194|----------------------------+------------------------------------+-------------------------------------------------------------------|
195| Evil state                 | Doom preset                        | =NORMAL=, =INSERT=, =VISUAL=, =V-LINE= or =V-BLOCK=, on a coloured tag |
196| Unsaved dot                | the buffer has unsaved edits       | a small dot                                                       |
197| Outline path               | the caret is under a heading       | the headings containing the caret, outermost first, as =Projects › House › Roof= |
198| Selection counts           | text is selected                   | lines, words and characters in the selection, as =count-words-region= |
199| Line and column            | always                             | =LINE:COLUMN= of the caret (the end of the selection)             |
200| Word count                 | always                             | words in the whole file, as =count-words=; click for the characters and reading time of the file and the selection |
201| Encoding notes             | the file differs from UTF-8 with LF | =Read-only=, =BOM= and =CRLF=, in orange                         |
202| Git branch                 | the file is in a Git repository    | the checked-out branch, or the first 7 characters of the commit when detached |
203
204Lines count from 1. Columns count from 0, as Emacs's =column-number-mode= does: a tab advances to the next multiple of 8, and wide characters such as CJK count as two columns. Hover over an item for a description.
205
206The word count follows edits after a pause. Reading time is at 230 words a minute, rounded up. The Git branch is read from the repository's =HEAD= file without running =git=, and checked again every 5 seconds; worktrees and submodules are followed.
207
208The running clock shows in the toolbar; see [[file:06-dates-and-clocking.org][Dates and clocking]]. The evil states are covered in [[file:03-keys.org][Keys and commands]].
209
210* The echo area
211
212The line under the modeline is the echo area, as Emacs's minibuffer. It shows:
213
214- *Messages* from commands, such as =Stored: …= or =Not an org file=. A message stays until the next key or click. View ▸ Messages lists the last 100.
215- *A pending key prefix*. After =C-c= it shows =C-c-=. If you pause for about 0.6 seconds, a grid of the keys that can follow appears, each with the command it would run at the caret, or =+prefix= for a further prefix, as =which-key= shows them. =C-g= cancels the prefix and shows =Quit=. A sequence that isn't bound shows, for example, =C-c z is undefined=, and does nothing; in the Doom preset this includes sequences after =SPC=.
216- *Prompts*, when a command asks a question.
217
218** Prompts
219
220A prompt shows its question and a text field, which takes the keyboard.
221
222- Type an answer and press =Return=.
223- When the prompt has choices (buffers, refile targets, tags), they list above the field, filtered as you type: characters match in order, and the best match is listed first and highlighted. The count at the right of the field shows the highlighted choice and the number of matches. =↑= and =↓= (or =C-p= and =C-n=) move the highlight, and =Tab= completes the field to the highlighted choice. =Return= accepts the highlighted choice when the prompt requires one of its choices or the highlight was moved, and the typed text otherwise. Clicking a choice accepts it.
224- Prompts that take several values, such as tags separated by colons, complete only the part after the last separator.
225- =Escape= cancels the prompt; the command reports =Quit=.
226
227Date prompts also show a date picker, and =S-<left>=, =S-<right>=, =S-<up>= and =S-<down>= move the date by a day or a week; see [[file:06-dates-and-clocking.org][Dates and clocking]]. TODO keywords and tags with fast-selection keys show a key menu instead of a text field; see [[file:05-todos-and-tags.org][TODOs and tags]].
228
229When a prompt closes, the keyboard goes back to the editor.
230
231* Completion
232
233Complete at Point (=completion-at-point=) completes the word before the caret from what Org knows at that position.
234
235| Preset | Key                                                      |
236|--------+----------------------------------------------------------|
237| Emacs  | =C-M-i=                                                  |
238| Doom   | =C-SPC= or =C-@= in insert state; the list also opens by itself after you type two characters and pause for 0.4 seconds, as Doom's corfu does |
239| Mac    | =⌥⎋= (Option-Escape) while Option is Meta; =⌃Space= stays with macOS, which switches input sources with it |
240
241With one candidate, it is inserted. With several, a list opens under the caret, showing up to 16 rows. Nothing is selected until you pick a row.
242
243| Key                         | In the list                                                                |
244|-----------------------------+----------------------------------------------------------------------------|
245| =C-n=, =<down>=, =C-j=      | Next candidate; past the last one the selection goes back to what you typed |
246| =C-p=, =<up>=, =C-k=        | Previous candidate                                                         |
247| =TAB=                       | Insert the selected candidate; with none selected, insert the part all candidates share |
248| =RET=                       | Insert the selected candidate; with none selected, close the list and insert a newline |
249| =ESC=                       | Close the list; the key then does what it otherwise would                  |
250| =C-g=                       | Close the list                                                             |
251
252The list follows what you type and closes when nothing matches. Candidates are those that start with what you typed.
253
254What is completed, by position:
255
256| Where                                        | Candidates                                                     |
257|----------------------------------------------+----------------------------------------------------------------|
258| =#+= at the start of a line                  | keyword names (=TITLE=, =STARTUP=, =OPTIONS=, …), in upper and lower case |
259| After =#+STARTUP:=                           | startup options                                                |
260| After =#+OPTIONS:=                           | export options                                                 |
261| After =#+DATE:=                              | today's date as a timestamp                                    |
262| After =#+EXCLUDE_TAGS:=, =#+SELECT_TAGS:=, =#+LANGUAGE:=, =#+PRIORITIES:= | the usual values                     |
263| =<= and a letter at the start of a line      | structure templates (=<s= for a src block and so on); see [[file:11-code-blocks.org][Code blocks]] |
264| After =#+BEGIN_SRC=                          | languages, then header arguments                               |
265| After =#+BEGIN: clocktable=                  | clock table options                                            |
266| After =[[=                                   | link types and the file's link abbreviations                   |
267| After =[[*=                                  | heading titles in the file                                     |
268| After =\=                                    | entity names                                                   |
269| After =:= at the end of a heading            | tags: those in =#+TAGS=, or else tags used in the file and across your folders |
270| After the stars of an empty heading          | TODO keywords                                                  |
271| =:= at the start of a line in a property drawer | property names the entry doesn't have yet                   |
272| =:= at the start of a line elsewhere         | drawer names                                                   |
273
274Elsewhere, Complete at Point reports =No match=. Completion is for org files only.
275
276* Electric pairs
277
278Typing an opening bracket inserts its closing partner, as =electric-pair-mode= does. The pairs are =()=, =[]=, ={}=, =<>= and a pair of double quotes.
279
280- Typing a closing character in front of the same closer moves over it instead of inserting another, skipping whitespace before it.
281- =DEL= between an empty pair deletes both.
282- =RET= between a pair opens a blank line between them.
283- With text selected, typing an opening or closing character, or a double quote, wraps the selection.
284- No pair is inserted where it would leave the brackets unbalanced (=electric-pair-preserve-balance=).
285
286Electric pairs are on by default and work in org files only. Set =electric-pair-mode = false= in =config.toml= to turn them off. Plain Emacs has them off; Doom pairs with smartparens.
287
288* Spell checking
289
290Spell checking is off by default. Turn it on for the current buffer with View ▸ Check Spelling While Typing (also in the palette; =SPC t s= in Doom normal state); the echo area says whether it is now on or off. To have it on in every file, turn on Settings ▸ Editing ▸ Check spelling while typing, or set =spell-check = true= in =config.toml=.
291
292Misspelt words are underlined, using the macOS spelling dictionary. In org files, orgstar doesn't mark words where spell-fu skips them: code, verbatim, links, timestamps, tags, TODO keywords, priorities, list bullets, checkboxes, keywords and affiliated keywords, planning and clock lines, property drawers, the first and last lines of drawers and blocks, the whole of src, example, export and comment blocks, LaTeX, entities, macros, targets, footnote references, citations, table formulas and fixed-width lines.
293
294orgstar never corrects spelling on its own; automatic spelling correction, text replacement and smart quotes and dashes are off.
295
296On iOS, spell checking follows =spell-check= in the synced =config.toml=, and is off by default. It leaves out the same text as on the Mac: misspelt words get a dotted red underline, and selecting one, or tapping it to show the edit menu, offers guesses and Learn Spelling. The word being typed is checked once the caret leaves it.
297
298* Wrapping and filling
299
300Long lines wrap at the edge of the editor by default. View ▸ Truncate Long Lines (=toggle-truncate-lines=) switches the current buffer to long lines that run off the right edge, with a horizontal scroll bar, and back. The echo area says which is now in effect.
301
302| Preset | Key                          |
303|--------+------------------------------|
304| Emacs  | =C-x x t=                    |
305| Doom   | =SPC t w= in normal state    |
306| Mac    | menu or palette only         |
307
308To truncate lines in every file, turn on Settings ▸ Editing ▸ "Long lines run off the edge instead of wrapping", or set =org-startup-truncated = true= in =config.toml=. The default is to wrap, as Doom does; Emacs's own default is to truncate.
309
310Wrapping is display only. To rewrap the text of a paragraph, use Org ▸ Fill Paragraph (=org-fill-paragraph=), which breaks the paragraph's lines at the fill column: =M-q= in the Emacs preset and in every Doom state, =⌃⌘P= in the Mac preset. With a selection, it fills every paragraph the selection touches. In Doom's normal and visual states, =gq= and =gw= with a motion fill the paragraphs in the lines it covers (=gqq= and =gww= for the current lines); =gq= leaves the caret on the last line, =gw= where it was. Unlike Fill Paragraph, =gq= and =gw= keep extra spaces between words and at the ends of lines, as Doom does. See [[file:03-keys.org][Keys and commands]]. The fill column is Settings ▸ Editing ▸ "Fill Paragraph wraps lines at column N" (80 by default, 40 to 200), or =fill-column= in =config.toml=.
311
312=auto-fill-mode= breaks lines as you type: typing a space past the fill column breaks the line at the last space before the column, as often as it takes, and the new line starts with the line's fill prefix, as =org-auto-fill-function= has it: a list item's text lines up under the item, a comment line starts with =#=, and headings, tables and code aren't broken. Turn it on for every file with =auto-fill-mode = true= in =config.toml=, or for the current buffer with View ▸ Auto Fill (=auto-fill-mode=, in the palette too); the echo area says =Auto-Fill mode enabled in current buffer= or =disabled=. Only a typed space fills, not =RET=.
313
314* View toggles
315
316The View menu shows a check mark next to each toggle that is on.
317
318| Toggle                        | Menu                          | Keys                                            | Default | =config.toml=                    | Scope          |
319|-------------------------------+-------------------------------+-------------------------------------------------+---------+----------------------------------+----------------|
320| Show Markup                   | View ▸ Show Markup            | =⇧⌘M=                                           | off     | =show-markup=                    | every buffer   |
321| Show Line Numbers             | View ▸ Show Line Numbers      | =⇧⌘L=                                           | off     | =display-line-numbers-type=      | every buffer   |
322| Auto fill                     | View ▸ Auto Fill                | palette                                       | off     | =auto-fill-mode=                 | current buffer |
323| Inline images                 | Org ▸ Show or Hide Inline Images | =C-c C-x C-v= (Emacs, Doom)                  | off     | =org-startup-with-inline-images= | current buffer |
324| LaTeX previews                | palette                       | =C-c C-x C-l= (Emacs, Doom)                     | off     | =org-startup-with-latex-preview= | current buffer |
325| Spell checking                | View ▸ Check Spelling While Typing | =SPC t s= (Doom)                                | off     | =spell-check=                    | current buffer |
326| Truncate long lines           | View ▸ Truncate Long Lines         | =C-x x t= (Emacs), =SPC t w= (Doom)             | off     | =org-startup-truncated=          | current buffer |
327
328Toggles that apply to the current buffer last until it closes; the =config.toml= setting decides how each file starts. Changing those settings, and =org-startup-indented= and =org-hide-leading-stars=, affects files opened afterwards, not buffers already open.
329
330** Line numbers
331
332Line numbers show in a margin left of the text, as =display-line-numbers-mode= shows them: one number per line of the file, so wrapped lines are numbered once and folded lines are skipped. The caret's line number is brighter. Line numbers are off by default, as in Emacs.
333
334View ▸ Line Numbers chooses how they count, as =display-line-numbers-type= does in =config.toml=:
335
336| View ▸ Line Numbers | =display-line-numbers-type= | Numbers                                                                           |
337|---------------------+------------------------------+-----------------------------------------------------------------------------------|
338| Absolute            | =true=                       | The line's number in the file.                                                    |
339| Relative            | ="relative"=                 | How many lines of the file away from the caret's line.                            |
340| Visual              | ="visual"=                   | How many lines on the screen away from the caret's, counting each wrapped line.   |
341
342In the relative and visual kinds the caret's line shows its own number, as =display-line-numbers-current-absolute= does. =display-line-numbers-type = false= turns the numbers off. The iOS editor has no line numbers.
343
344* Themes
345
346The editor's font, size, line spacing and heading sizes are in Settings ▸ Appearance. Settings ▸ Appearance ▸ Theme chooses a built-in theme for the light appearance and one for the dark: Default, Solarized Light, Gruvbox Light, Modus Operandi, Catppuccin Latte, Tomorrow or Paper; and Default, Solarized Dark, Gruvbox Dark, Modus Vivendi, Catppuccin Mocha, Nord, Dracula, Tokyo Night or doom-one. They are =light-theme= and =dark-theme= under =[theme]= in =config.toml=. Colours set in =config.toml=, under =[theme]= for both appearances, =[theme.light]= and =[theme.dark]= for one and =[theme.todo]= for TODO keywords, apply on top, as do those of a theme file named by =theme-file=. Copy to Config Folder writes the two chosen themes, every colour, into =my-theme.toml= and makes it the theme file, to start a theme of your own. Show Default Theme opens =default-theme.toml=, which lists every colour with its default value. Changes apply while orgstar runs. See [[file:13-configuration.org][Configuration]].
347
348Settings ▸ Appearance ▸ App Icon chooses the icon the Dock shows while orgstar runs. Finder, and the Dock once orgstar has quit, show the default icon, in the system's icon style (Default, Dark or Tinted).
349
350The iOS editor uses the same theme and display settings, read from the synced =config.toml=; see [[file:14-ios.org][iPhone and iPad]].
351
352* Undo
353
354Each buffer has its own undo history, kept while other buffers show.
355
356| Action | Menu        | Mac     | Emacs preset              | Doom (normal state) |
357|--------+-------------+---------+---------------------------+---------------------|
358| Undo   | Edit ▸ Undo | =⌘Z=    | =⌘Z=, =C-/=, =C-_=, =C-x u= | =u=                 |
359| Redo   | Edit ▸ Redo | =⇧⌘Z=   | =⇧⌘Z=                     | =C-r=               |
360
361A command's whole change undoes in one step, separately from the typing around it. Restoring a recovery version and resolving a Syncthing conflict copy can be undone too.
362
363The undo history is cleared when the buffer reloads or merges changes from disk, and when you take the disk version or merge with markers to settle a conflict; see [[file:01-files-and-folders.org][Files, folders and buffers]]. The Emacs preset has no redo key other than =⇧⌘Z=, and undo is linear, not Emacs's undo tree.
364
365* Finding text in a file
366
367=C-s= and =C-r= in the Emacs preset search as you type (=isearch-forward=, =isearch-backward=): the echo area shows =I-search:= and what you have typed, the next match is selected as each character goes in, and the other matches are highlighted. While searching:
368
369| Key           | What it does                                                                                       |
370|---------------+----------------------------------------------------------------------------------------------------|
371| characters    | Add to the search string.                                                                          |
372| =C-s=, =C-r=  | The next or previous match; with nothing typed yet, the last search again. After =Failing I-search=, the search wraps around the file (=Wrapped I-search=). |
373| =DEL=         | Undo the last key: a character, or a move to another match.                                        |
374| =RET=         | Stop, with the caret after the match (before it going backward).                                   |
375| =C-g=         | With a failing search, take off the part that fails; otherwise stop and go back to where the search began. |
376| other keys    | Stop where the search is, then run as usual.                                                       |
377
378A space matches any run of spaces and tabs, and an upper-case letter makes the search case-sensitive, as Emacs's defaults have it. =C-M-s= and =C-M-r= search with a regular expression (=isearch-forward-regexp=); patterns are ICU regular expressions. Folded text opens around a match. In Doom, =/= and =?= search the same way with a regular expression, the echo area showing =/= or =?= and the pattern; =RET= ends it as Vim's search does, so =n= and =N= repeat it, and =Esc= or =C-g= go back. On iOS, =C-s= and =C-r= work with a hardware keyboard, and Incremental Search is in Commands; typing on the on-screen keyboard adds to the search. iOS doesn't highlight the other matches.
379
380Edit ▸ Find opens the find bar above the text.
381
382| Menu item                         | Shortcut | Emacs preset      | Doom                  |
383|-----------------------------------+----------+-------------------+-----------------------|
384| Edit ▸ Find ▸ Find…               | =⌘F=     |                   | =SPC s s=             |
385| Edit ▸ Find ▸ Find and Replace…   | =⌥⌘F=    | =M-%=             |                       |
386| Edit ▸ Find ▸ Find Next           | =⌘G=     |                   |                       |
387| Edit ▸ Find ▸ Find Previous       | =⇧⌘G=    |                   |                       |
388| Edit ▸ Find ▸ Use Selection for Find | =⌘E=  |                   |                       |
389
390In Doom, =:s/PATTERN/REPLACEMENT/= and =:%s/…/…/= with the =g= and =i= flags substitute with regular expressions on the current line or in the whole file.
391
392To search all your files, use the toolbar's search field; see [[file:01-files-and-folders.org][Files, folders and buffers]].
393
394* Accessibility
395
396The editor works with VoiceOver. VoiceOver reads the text as it is shown rather than as stored: hidden link brackets and targets, hidden emphasis markers and hidden stars are skipped, entities are read as the characters drawn for them, and narrowed table columns are read as drawn. Folded text is still read, so the whole file is available. Lines, the caret position and the selection are reported in terms of the shown text.
397
398Other parts of the window are labelled: tabs in the tab bar are buttons, with the current one marked selected, and each close button names its buffer and says whether it is unsaved; the outline pane's divider is an adjustable Outline width; the modeline's unsaved dot reads "Unsaved changes", and the Doom state tag reads, for example, "Normal state".
399
400The editor keeps the system's keyboard navigation and text editing; the presets only add bindings. See [[file:03-keys.org][Keys and commands]].
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form