Skip to content

Tools ​

The toolbar's tools menu holds Format File, Lint File, Info, Share, Export PDF, and in a git project View History and View Diff. Everything runs on the device; no file leaves it.

Formatting ​

Format File rewrites the current file with the language's standard formatter:

LanguageFormatter
Gogofmt with imports grouped, as goimports does
Pythonruff
JavaScript, TypeScript, JSON, CSS, GraphQLbiome

Only these file types are formatted, and the menu item is dimmed for anything else. Markdown, YAML, HTML and single-file components such as .vue are left alone on purpose: the bundled formatters either do not carry them or would damage them.

Indentation follows the editor's own indent settings. Everything else is the formatter's default unless changed under Settings → Code Formatting: Line Length, and per tool the quote style, semicolons, trailing commas and the like. A ruff.toml, pyproject.toml or biome.json in the project takes precedence over all of it.

Format on Save, off by default, formats as part of every save. A file with a syntax error is saved as typed.

Format selection and Format a range format part of a file — from the command palette, or bound to a key — for Python and the biome languages; Go has no range formatter, so there the whole file is the unit. A format the formatter refuses says why on the status bar, and the message's detail offers to open the Problems panel, which runs the lint and lists what stopped it.

Trailing spaces and the final newline ​

Trim Trailing Spaces in the Tools menu removes the spaces and tabs at the ends of lines. It asks first whether to trim the Whole File or only the Changed Lines: in a git project the lines that differ from the index, the same comparison View Diff shows; in a file workspace the lines that differ from the file as it was opened, or as it was after a change made outside the app. A file git does not know yet counts as changed on every line. The status bar says how many lines were trimmed. It is one undo step.

The same trim can run on every save. Under Settings → Editor → On Save, set Trim Trailing Spaces to Changed Lines or Whole File; it is None until you do. An autosave leaves the line under the cursor alone, so a pause after a word does not glue it to the next one; a save you ask for trims it too. Add Final Newline adds the newline a file is missing at its end on every save. When Format on Save is also on, the formatter runs first.

Markdown's two-space line breaks are trailing spaces too, and so is space at the end of a line inside a multi-line string; the trim does not know the difference. The default scope keeps it to the lines you touched.

Linting ​

Lint File checks the file with revive for Go, ruff for Python, and biome for JavaScript, TypeScript, JSON and CSS. Problems are underlined in the editor and counted in the status bar; tap the count, or the gutter mark, for the Problems panel. Tapping a problem jumps to it. A Go file that does not parse lists every syntax error, and no rule runs until it does.

Some problems carry a fix the tool considers safe: Fix on the row applies it, Fix all in the panel header applies every safe one. Fixes the tool marks unsafe are never offered. A problem's menu also has Suppress on this line, which writes the tool's own ignore comment, Disable rule, which turns the rule off for you, and Rule documentation.

Under Settings → Code Diagnostics, Lint as you type keeps the file checked as you edit, Underline problems toggles the marks, and each tool has a Rules screen listing every rule with a switch. A project's own config file wins over those switches, and the panel says so when it does.

View Diff ​

In a git project, View Diff swaps the editor for the file's unstaged changes against the index, with the same diff viewer the Git mode uses. Show source on the toolbar returns to editing.

Info, Share, Export PDF ​

Info shows the file's size, type, dates and location. Share hands the file to the iOS share sheet, for another app or the Files app; a folder is shared as a zip. Export PDF renders the file with syntax highlighting, or a Markdown file as its rendered document, headed by the project, branch and commit, and hands the PDF to the share sheet. Settings → PDF Export chooses the theme, font size, tab width, line numbers, whether long lines wrap, the header, paper size and orientation.

The same items are on a file's long-press menu in the sidebar, and the Git mode's history can share a commit as a patch.

See also ​

Last updated: