Skip to content

Keyboard shortcuts

Every key and modifier in midcode, grouped by what you're doing: tools, selection, editing, moving, the canvas, text, code and the database.

View as Markdown

midcode’s shortcuts follow Framer and Figma where there’s a habit to follow. Single keys (V, C, F) work whenever you aren’t typing, in the editor and after a click inside a frame. They do nothing while a text field has the cursor, while you edit a text on the canvas, or while Settings is open.

Commands with ⌘ are also in the menu bar, under “File”, “Edit”, “Element” and “View”.

Tools

KeyAction
VInspect: click to select.
CComment: click an element to pin a comment. Opens the “Comments” list.
PPreview the site, full size and running. P or Esc comes back.
FIn a Next.js App Router project: draw a frame on the canvas. Elsewhere, and while editing a component: insert a frame.
EscLet go, one thing at a time: the frame tool, a picked guide, floating elements picked together, a comment being written, the open comment, the selection, the tool, the Insert or Comments panel, the component being edited.

Insert

These add the item at the selection, or at the end of the page when nothing is selected. See Insert.

KeyInserts
FA frame, in projects where F doesn’t draw one
SA stack
TA text
⇧GA grid
⇧IAn image (asks for a file)
⇧VA video (asks for a file)

Select

KeyAction
ClickSelect the element.
⇧ClickAdd it to the selection, or take it out. On the canvas and in Layers.
⌘ClickInside the selection: select its parent. Again for the next one up.
⌘↑Select the parent.
⌘AAdd every sibling of the selection. With nothing selected: everything floating on the canvas.
Double-clickEdit a text. On a component instance: open the component.
EscDeselect.

Edit

KeyAction
⌘ZUndo the last edit.
⇧⌘ZRedo.
⌘CCopy the element: midcode keeps it for ⌘V, and the system clipboard gets its reference (what it is and its file:line:col), to paste to an agent.
⌘XCut.
⌘VPaste after the selection. With an image or files on the clipboard: paste those.
⌘DDuplicate.
⌫Delete the selection. Delete does the same.
⇧AWrap the selection in a stack.
⌘;Hide or show the element.
⌥⌘CCopy styles.
⌥⌘VPaste styles.
⇧⌘CCopy only the element’s reference (“Copy Reference” in the Element menu).
⌘RRename the layer.
⌥⌘RAuto rename the layer (Apple Intelligence).

With several elements selected, ⌘C, ⌘X, ⌘D, ⌫ and ⇧A apply to all of them, and ⌘C puts their code on the system clipboard. In files that aren’t JSX, see the limits in Select, move and resize.

Move, resize and rotate

KeyAction
Arrow keysMove a positioned or floating element 1 px.
⇧ + arrow keysMove it by the nudge amount (10 px, or what you set in Settings).
⌥ while draggingAn element in the flow, or a floating one: leave a copy where you release. The element stays. In files that aren’t JSX, from the next release and within the same file.
⇧ while draggingA positioned or floating element: move along one axis.
⌘ or ⌃ while draggingNo snapping. Press it once the drag has started.
⇧ on a corner handleKeep the proportions.
⇧ while rotatingTurn in steps of 15°.
Esc while draggingCancel the move.

“Positioned” is an element placed with left and top; “floating” is one on the free canvas. An element in the flow moves by dragging: see Select, move and resize.

Padding, gap and radius handlesNext release

KeyAction
⌥ on a padding handleSet the opposite side too.
⌥⇧ on a padding handleSet all four sides.
⌥ on a radius handleRound that corner only.

Canvas and view

KeyAction
ScrollPan.
Space + dragPan.
Pinch, or ⌘ + scrollZoom.
⌘=Zoom in.
⌘-Zoom out.
⌘0Actual size.
⌘1Zoom to fit. ⇧1 does the same.
⇧2Fit the first frame.
RShow or hide the rulers and guides. ⇧R does the same.
⌫With a guide clicked: remove it.
Esc in the PreviewBack to the canvas. With the interface hidden: show it.

Text and fields

KeyAction
Double-clickEdit a text in place.
EnterSave the text.
EscCancel.
↑ ↓ in a number fieldAdd or take 1. The element changes when the keys rest.
⇧↑ ⇧↓ in a number fieldAdd or take the nudge amount.
⇧ while dragging a field’s unitScrub in steps of the nudge amount.
Arrow keys on a sliderOne step. With ⇧: ten.
⌥ while dragging a sliderMove in single units instead of the slider’s steps.
Enter on a sliderType a value.

Comments and layers

KeyAction
CThe comment tool.
⌘↵Save the comment you’re writing.
EscCancel it, or close the open comment.
Double-click a layerRename it. Enter keeps the name, Esc drops it.
Double-click a breakpoint in LayersBring its frame into view.

Code

In “Open code” and in the Code view. See Code view.

KeyAction
⌘SSave the file. It’s one undoable edit, listed in Publish.
⌘FFind in the file.
⌘ZUndo in the editor: your typing, not the project’s edits.
TabIndent.
EscClose “Open code” and go back to the canvas.
⌃`Show or hide the terminal, in the Code view.

Agent

In the prompt of the agent’s chat. See Your agent in midcode.

KeyAction
EnterSend.
⇧EnterA new line.
@Add context: the selected element, the open comments, the page, files.
/At the start of the prompt: the agent’s commands.
↑ ↓, then Enter or TabChoose in the @ or / menu.
EscClose the menu, stop picking, or stop the agent while it works.

DatabaseNext release

The SQL editor:

KeyAction
⌘↵Run what’s selected, or everything.
⌘SSave the query.
TabAccept the completion.

A table:

KeyAction
Arrow keysMove between cells. ⇧↑ and ⇧↓ jump a screen of rows.
Enter, or start typingEdit the cell.
EnterWhile editing: keep the value.
Tab, ⇧TabWhile editing: keep it and go to the next or previous column.
⌘↵In the editor for a long value: keep it.
EscWhile editing: drop the change. Otherwise: deselect.
⌘CCopy the cell.
⌫Delete the rows you picked.
⌘SSave the waiting changes to the database.

The app

KeyAction
⌘NFrom the next release: a new project (the hub, with “New project” open).
⌘OOpen a folder.
⇧⌘HBack to the projects, without closing the tab.
⌘,Settings.
EscClose what’s in front: Settings, a menu, the CMS, Languages or Site settings (back to the canvas). From the next release, Database and Store too.