Appearance
Editor basics
The editor is CodeMirror 6, the same engine behind many desktop and web editors, running inside the app. This page covers the everyday surface: opening files, moving around, finding things, and the common edits.
For formatting, linting, diffs and export, see Tools. For the accessory bar above the soft keyboard, see Custom keyboards.
The workspace
A git project has three modes on the rail at the left edge: Editor, Git and History. On a phone in portrait there is no rail, and the mode menu sits on the toolbar. The file workspace opened from the Files card has the editor only.
The sidebar and the editor share the screen. The control at the start of the toolbar has three states: in the split, it is a divider you tap to hide the sidebar or drag to widen it; with the sidebar hidden, a chevron brings it back; with the sidebar expanded over the editor, a chevron restores the editor, as does tapping a file. Cmd+B toggles the sidebar, Cmd+\ puts the editor full screen, and Cmd+\ again brings the chrome back. By touch, the toolbar's full-screen button does the same; in full screen the toolbar, tab bar and status bar are gone, and the way back shows when you touch or scroll the page — a round button like the floating one, on the opposite side, which fades after a moment of quiet — or from the floating button's long-press menu, Exit Full Screen. The floating button itself stays. The exit button appears only on a touch, so from a hardware keyboard, with the floating button turned off in Settings, Cmd+\ is the way out.
The status bar shows the active file's folder, a problems count that opens the Problems panel, the save state, and Ln, Col. With a hardware keyboard attached it also shows a caps pill while Caps Lock is on, and while Vim mode is active — on, with the hardware keyboard attached and the soft keyboard down — the mode (NORMAL, INSERT…) as a pill at its left edge, coloured by mode. A message — a key refused, a format or a lint's word, a script's output — shows in the save state's place for a moment; one with more than fits (a second line, or a line too long for the bar) has a speech-bubble button beside it that opens the whole message, and the button stays after the message clears; a format refusal's also offers the Problems panel.
With a hardware keyboard attached, a sheet — the view options, the file structure, the Problems panel, a picker — carries a highlight: j k and the arrows move it, Enter presses the row, Space toggles a switch, h l and ←/→ adjust a stepper or a choice row, Esc closes the sheet. A dialog's buttons carry one too: h l, the arrows and Tab move it, Enter presses the highlighted button, Esc cancels; a dialog opens on its safe button. None of this needs vim.
Editor options, the gear on the toolbar, holds the font size, line numbers and their style, wrapping, whitespace highlighting, code folding, the status and tab bars, and in a git project a Read-only switch — on and locked on the free plan. While a diff is showing, the Read-only switch and the toggles that do not apply to a diff give way to Diff Style; while the preview is showing, the gear is off the toolbar. With the sidebar hidden, the project search and Recent files sit after it.
Searching lists
Every list you narrow by typing — the file picker, the tab switcher, the recent files, the file structure, the command palette, the snippet lists, the branch, tag and author pickers, the repository picker, the keys picker — matches the same way:
- the letters you type need only appear in order:
fppfindsFilePickerPalette.tsx,tog sidfinds Toggle sidebar; - words in any order, each matched on its own:
sid togfinds it too; - a
/in what you type reaches into folders — file paths, branch names likefeature/foo-bar,owner/namerepositories; - the matched letters are marked in each row;
- the best match comes first, except where the list's own order is the point: the recent files stay newest first, the file structure in the file's order, the keys picker in its sections.
Where a row has more than a name, the rest matches as plain text after the name matches: a repository's description, an author's email, a snippet's id or language, a key's id. The file-content search, find in file and the commit search look for exactly what you type, as they should.
Files and tabs
Tap a file in the sidebar to open it. By default it opens in a single preview tab, shown in italics, that is reused as you browse; editing the file, double-tapping the tab, or tapping its pin makes it a permanent tab. Every tab has a close button. The tab list's menu offers Close Others and Close All.
Saves can also tidy the file: Settings → Editor → On Save trims trailing spaces and adds a missing final newline, described under Trailing spaces and the final newline.
To open every file in its own tab, turn on Open Files in New Tab under Settings → Editor → Tabs. Maximum Open Tabs caps them, 16 by default, and the least recently used tab is saved and closed when the cap is hit; a tab with unsaved changes never is.
Images preview inline. PDFs, Office documents, audio and video open in the system previewer. Anything else offers Share instead of a tab. Long-press a file for Open or Preview, Share, Info, Export PDF, New File, New Folder, Delete, Move, and in a git project View History. Renaming is done on the Move screen.
Getting around
Cmd+P searches the project by file name, Cmd+Shift+F by content, Cmd+T by symbol. Cmd+P and Cmd+T match the way every list here does — see Searching lists — and Cmd+P reaches a file through its folder too:
ws/fppfindscomponents/workspace/FilePickerPalette.tsx. The same three live on the toolbar's project search, whose mode menu switches between File names, File content and Symbols, with a file-type filter and Case sensitive and Words options. File names, and the sidebar's search, match by the file's name the same way, a/reaching into folders; Words asks for the exact word instead, and Case sensitive means what it says.Cmd+Shift+O lists the current file's structure: functions, classes, headings.
Cmd+E switches tabs from a list; Cmd+Shift+] and Cmd+Shift+[ go to the next and previous tab; Cmd+W closes the current one.
Cmd+R reopens a recent file.
Ctrl+G goes to a line.
Cmd+Shift+P runs any command by name.
Cmd+1, Cmd+2, Cmd+3 switch to the Editor, Git and History modes.
Cmd+, opens Settings; Cmd+0 goes Home.
The floating button in the editor's corner does the same by touch. By default, tap opens the file structure, swipe up the open tabs, swipe down the command palette, and swipe left and right move between tabs. Long-press it for a two-page menu: Gestures lists what each swipe does, More lists every other action, including recent files, the three searches, full screen, format and lint. Every gesture can be reassigned under Settings → Floating Action Button, along with the button's size and position, whether it shows at all, and Non-sticky File Structure, which closes the panel after a jump. The panel's pin keeps it open for the current visit.
Find and replace
Cmd+F opens find in the current file. The menu on the field toggles Match Case and Words. The plus button reveals the replace row with Replace, Skip and Replace All. On a hardware keyboard the same search shows the match count and has its own toggles; Cmd+G and Cmd+Shift+G step through matches even with the bar closed. There is no regular-expression search, and no replace across files.
Multi-cursor and selection
- Cmd+D adds the next occurrence of the selection as a cursor; keep pressing to add more. Cmd+Opt+D skips the current one and takes the next. Cmd+U drops the last cursor, and Cmd+Shift+U goes back to a single one.
- Cmd+Shift+L selects every occurrence at once.
- Cmd+Opt+Up and Cmd+Opt+Down add a cursor on the line above or below.
- Cmd+L selects the line, Cmd+Shift+A grows the selection to the enclosing syntax node.
- Cmd+Shift+\ jumps to the matching bracket, Cmd+Opt+\ selects up to it.
Line edits
- Tab and Shift+Tab indent and outdent, as do Cmd+] and Cmd+[.
- Cmd+/ toggles the line comment for the file's language.
- Opt+Up and Opt+Down move the line.
- Cmd+Shift+K deletes the line.
- Ctrl+U and Ctrl+K delete to the start and end of the line.
- Cmd+Enter inserts a blank line below.
- Cmd+Opt+[ folds or unfolds at the cursor, with the fold markers in the gutter when Show Code Folding is on.
Every binding is listed and changeable under Settings → Keyboard Shortcuts, where a row can be captured to a new combo, disabled, or reset. iOS keeps some combos for itself, among them Cmd+Ctrl with a letter, Ctrl+Tab, Cmd+Shift+V and Cmd+period; the screen warns when you choose one.
Preview
Markdown and SVG files have a preview toggle on the toolbar, the eye icon, or Cmd+Opt+M. Markdown renders in place with its headings navigable from the structure panel; links open, and the scroll position survives switching back and forth. Math and Mermaid diagrams are not rendered yet. SVG shows the image scaled to fit.
Saving
Files save on their own a moment after you stop typing, and immediately when the app goes to the background or you switch tabs. Cmd+S saves now. The status bar reads Unsaved changes while an edit is pending and Saved once it is on disk. Format on Save under Settings → Code Formatting runs the formatter as part of the save.
Saving writes the file to disk, not to git. For commits, see Committing changes.
