While the agent handles complex tasks, you can also edit code directly in twig. This page covers the built-in editor features.
Twig's editor is built on CodeMirror, providing a fast and capable editing experience.
cmd + p and type the filenameMultiple files open as tabs at the top of the editor:
cmd + s to save immediatelyTwig recognizes common languages and file types:
Line numbers appear in the left gutter. Click a number to select the entire line.
Twig detects and matches your project's indentation style:
Use tab to indent, shift+tab to outdent.
Collapse blocks of code to focus on what matters:
cmd + shift + [ to foldcmd + shift + ] to unfoldcmd + f opens find in the current file:
cmd + h opens find and replace:
cmd + shift + f searches across all files:
Edit multiple locations simultaneously:
cmd + click to add cursorscmd + d to select next matchcmd + shift + l to select all matchesType, delete, or paste - the action applies to all cursor locations.
Common editing shortcuts:
| action | shortcut |
|---|---|
| save | cmd + s |
| undo | cmd + z |
| redo | cmd + shift + z |
| cut line | cmd + x (with nothing selected) |
| copy line | cmd + c (with nothing selected) |
| move line up | opt + up |
| move line down | opt + down |
| duplicate line | cmd + shift + d |
| delete line | cmd + shift + k |
| toggle comment | cmd + / |
The editor and agent work together: