Writing

This page covers the tools that help you write: completion, formatting, editing in several places at once, tables, images and folding.

Completion and snippets

Typo suggests completions from the Typst engine. Suggestions know your document: variables, functions from imports, built-ins, and labels and bibliography keys that you can reach from the current file. Names from other files are suggested too, and accepting one adds the import.

To ask for completions yourself, press F5 or ⌥Esc. To stop suggestions while typing, or to change how you accept one, open Settings › Editing › Completion.

Snippets are in the library. To open it, choose View › Library… (⇧⌘L). It also holds images, symbols and fonts. To manage your own snippets, open Settings › Snippets.

A completion list under the caret suggesting the inset parameter, with a one-line description A completion list under the caret suggesting the inset parameter, with a one-line description
Completion suggests what fits at the caret, with a short description.

Formatting

Typo formats code with typstyle.

To format every time you save, turn on Format on Save in Settings › Editing. Autosave never formats. The line width and indent width come from the Display and Indentation settings.

The Format menu also has Bold (⌘B), Italic (⌘I), Underline (⌘U), Bullet List, Numbered List and Math. They wrap the selection in Typst markup, or remove it again.

Multiple cursors

Vim mode

To edit with Vim keys, choose View › Vim Mode. Press Esc for Normal mode, i to insert and v to select. The commands :w, :q and :wq work. A mode capsule shows the current mode.

Spell check

Typo checks spelling in the language you set with #set text(lang: …). Math is not checked.

Tables

The table editor shows a table(…) or grid(…) as a grid, like a spreadsheet.

Cells are typeset by Typst, so math, references and your #set rules show as they will print. You edit with arrow keys, Tab, Return and Esc, and copy and paste work like in a spreadsheet. You can paste tab- or comma-separated data from Numbers or Excel, and the table grows to fit.

The editor can also insert, delete, duplicate and move rows and columns, merge and split cells, set alignment, bold and italic, set column widths, and apply a style: Plain, Grid, Header Line, Booktabs or Striped. It has fields for the figure caption, label and placement.

Press Done to apply the changes. They land in your document as one undo step.

The Intelligence popover in the table editor changes a table from a request in your own words, such as sorting or adding a totals row. It needs a model provider, see Assistant.

The table editor with the grid on the left and the typeset preview on the right The table editor with the grid on the left and the typeset preview on the right
The table editor: edit cells on the left, see the typeset table on the right.

Images

To add an image, drop an image file onto a Typst file in the editor, or paste an image. Typo turns it into a figure. You can also use the images tab in the library (View › Library…).

Colour swatches

A small swatch appears next to colours such as rgb(…). Click it to open a colour picker next to the line. The picker has a wheel or sliders, and you can edit the numbers and the hex value.

A colour swatch next to an rgb value with the picker popover open A colour swatch next to an rgb value with the picker popover open
Click a swatch to change the colour with the wheel, sliders or values.

Folding

You can collapse headings, brackets, figures, tables, math, raw blocks, comments and lists. Click the ribbon next to the line numbers, or use the View menu:

The duration of the fold animation is in Settings › Editing › Display.

More editor options