Keyboard Shortcuts
Last updated:
This page lists keyboard shortcuts and mouse interactions available in the Mermaid Studio diagram preview. Shortcuts follow standard JetBrains conventions and can be customized in Settings > Keymap (search for “Mermaid”).
Zoom and Pan
Section titled “Zoom and Pan”Command + 0 Command0 Control + 0 Ctrl0 fits the diagram to the viewport (capped at 100%)Command + Shift + 0 CommandShift0 Control + Shift + 0 CtrlShift0 sets zoom to exactly 100%Command + Plus Sign Command+ Control + Plus Sign Ctrl+ orCommand + Equal Sign Command= Control + Equal Sign Ctrl= zooms inCommand + Minus Sign Command- Control + Minus Sign Ctrl- zooms out- Arrow keys pan the diagram by 50 pixels per press
Command Command Control Ctrl + scroll wheel performs focal zoom (toward cursor)- Scroll wheel zooms in and out
- Middle-click drag pans the diagram
The fit / actual-size shortcuts work from either the source editor or the preview pane, so you don’t need to focus the preview before resetting the view. Zoom in / out require the platform-native modifier so they don’t interfere with typing while an inline label edit is open.
Edit Mode
Section titled “Edit Mode”Edit mode features require a paid license (Core or Studio).
Selection
Section titled “Selection”- Click an element to select it
- Shift+Click to add or remove an element from the selection
- Click+Drag on an empty area to marquee-select multiple elements
Command + A CommandA Control + A CtrlA selects all elementsAlt + Shift + P AltShiftP Alt + Shift + P AltShiftP selects the parent subgraphAlt + Shift + C AltShiftC Alt + Shift + C AltShiftC selects all children of the current subgraphAlt + Shift + S AltShiftS Alt + Shift + S AltShiftS selects all siblings at the same level
Editing
Section titled “Editing”- Double-click a label to edit it inline
Command + B CommandB Control + B CtrlB toggles bold on the selected element’s label (works with multi-selection)Command + I CommandI Control + I CtrlI toggles italic on the selected element’s label (works with multi-selection)Command + G CommandG Control + G CtrlG groups selected elements into a new subgraphCommand + Shift + G CommandShiftG Control + Shift + G CtrlShiftG ungroups the selected subgraph, lifting its members into the parent scopeMinus Sign - Minus Sign - collapses the selected flowchart subgraphs (Mermaid.js 11.17.0+)Plus Sign + Plus Sign + orEqual Sign = Equal Sign = expands the selected flowchart subgraphs; clicking a collapsed subgraph’s ellipsis row expands it too- Delete removes the selected element or elements
Command + Z CommandZ Control + Z CtrlZ undoes the last edit mode operation
Navigation
Section titled “Navigation”In preview mode, clicking an element triggers built-in Mermaid.js interactivity (actor menus, external links, etc.).
Hold
In edit mode, a plain click navigates to the element’s source declaration.
Hold
Appearance Menu
Section titled “Appearance Menu”The Appearance dropdown on the preview toolbar works from the keyboard.
Command + L CommandL Control + L CtrlL selects the Light variantCommand + D CommandD Control + D CtrlD selects the Dark variantTab Tab Tab Tab andShift + Tab ShiftTab Shift + Tab ShiftTab cycle between the mode toggle, the theme grid, the Manage… link, the custom theme grid, the look grid, the font grid, and the custom font field- Arrow keys move the focus ring within a grid;
Home Home Home Home andEnd End End End jump to the first and last tile Enter Enter Enter Enter orSpace Space Space Space applies the focused tile
The popup opens with focus on the Light/Dark toggle. See Live Preview for what each group does.
Shape Picker
Section titled “Shape Picker”The shape picker that opens from the edit mode toolbar has three focus stops: the category tab strip, the shape grid, and the No Shape link.
Tab Tab Tab Tab andShift + Tab ShiftTab Shift + Tab ShiftTab cycle between the three stops and wrap aroundLeft Arrow Left Left Arrow Left andRight Arrow Right Right Arrow Right on the tab strip switch categories- Arrow keys move between shapes in the grid;
Home Home Home Home andEnd End End End jump to the first and last shape Enter Enter Enter Enter orSpace Space Space Space picks the focused shape
The picker opens with focus on the grid.
Find in Preview
Section titled “Find in Preview”Command + F CommandF Control + F CtrlF opens the search bar in the diagram preview
Element Style Pane
Section titled “Element Style Pane”Control + Command + Up Arrow ControlCommandUp Control + Alt + Up Arrow CtrlAltUp navigates between a link and itslinkStyledeclaration (Go to Related)Enter Enter Enter Enter commits a text or numeric field;Escape Escape Escape Escape reverts an edited field to its loaded valueTab Tab Tab Tab moves between controls without committing an unchanged field- Arrow keys move between preset chips;
Enter Enter Enter Enter orSpace Space Space Space applies the focused preset
In the color picker’s Color Wheel mode, the arrow keys move hue and chroma,
See Style Pane for the full keyboard model, including the preset gallery popup and the color picker.
See Also
Section titled “See Also”- Live Preview for zoom, pan, and toolbar details
- Edit Mode for the full interactive editing guide
- Style Pane for visual CSS styling controls
- Custom Themes for the Switch Diagram Theme popup and its shortcuts