Cmd+E / Ctrl+E (or the edit button in the toolbar) to switch from the preview to the editor, and Cmd+S / Ctrl+S to save. Esc or Cmd+E takes you back to the preview. If you try to leave a file with unsaved changes, Maestro asks first.
The editor is built on CodeMirror 6. It edits source code, markdown, config files, and plain text, and it follows your theme and your File Editor font settings.
What the editor does
Autocomplete
In code files the completion list opens as you type. It always offers words already in the file, and adds the language’s own suggestions where the language provides them:- JavaScript and TypeScript: keywords, snippets (
for,if,function,class), and names declared in the file. - CSS and SCSS: property names and values.
- HTML (and HTML inside markdown): tag and attribute names.
- Python: keywords and names declared in the file.
- SQL: keywords.
- JSON, YAML, and the rest: words from the file.
Up and Down, accept with Tab or Enter, and close it with Esc. Ctrl+Space opens it on demand.
In markdown and plain-text files the list does not open by itself, so Enter after a word always starts a new line. Press Ctrl+Space when you want it. Very large files (the Giant tier, over 8 MB) skip completion so typing stays fast.
Multiple cursors
Everything you type goes to every cursor at once.Opt+Click/Alt+Clickadds a cursor where you click. Your platform’s usualCmd+Click/Ctrl+Clickworks too.Cmd+D/Ctrl+Dselects the next occurrence of the current selection, with its own cursor. Press it again for the one after that.Shift+Opt+Drag/Shift+Alt+Dragdraws a rectangular (column) selection, one cursor per line.Escgoes back to a single cursor. A secondEscleaves the editor.
Find and replace
Cmd+F / Ctrl+F opens the same find bar the preview uses. In the editor it has a second field, Replace with:
- Type the search in the first field, then
Tabto the Replace field. Enterreplaces the current match and moves to the next one.Cmd+Enter/Ctrl+Enter, or the Replace All button, replaces every match. OneCmd+Z/Ctrl+Zundoes the whole replacement.- The chip on the left of the find field picks Text (plain, case-insensitive) or Regex. In regex mode the replacement can use
$1,$2, … for capture groups,$<name>for a named group, and$&for the whole match.
Editing shortcuts
Cmd+/ is Show Shortcuts everywhere else in Maestro; while the editor has focus it toggles a comment. Cmd+[ and Cmd+] keep switching agents, so indent with Tab and Shift+Tab. The full list is on the Keyboard Shortcuts page.
Hand a selection to an agent
Select some text in the editor and right-click it:- Quote in Message puts the selection into the agent’s message box as a quote, with the file path and line range on top, and moves you to the agent’s chat with the caret below it. Type your question and send. Quote several passages in a row to ask about them together.
- Send to Agent opens the Send to Agent dialog with the same passage, so you can hand it to a different agent.
- Copy to Clipboard copies just the selected text.
Vim mode
Turn on Vim keybindings in the editor under Settings -> Display -> File Edit & Preview. It is off by default. With Vim mode on, the editor starts in normal mode and supports insert and visual modes, motions, operators, registers, and: commands. A status line under the editor shows the mode and the command you are typing. Esc returns to normal mode instead of leaving the editor; use Cmd+E / Ctrl+E to go back to the preview, and Cmd+S / Ctrl+S to save.