Skip to content

Keyboard Shortcuts

This is the primary reference for all keyboard shortcuts.

These shortcuts work anywhere in the app, regardless of what’s focused.

Shortcut Action
Command + S Control + S Command + S Save current file
Command + N Control + N Command + N Create new file in the current collection
Command + W Control + W Command + W macOS: close the window (click the Dock icon to bring it back as it was). Windows and Linux: close the current file
Command + P Control + P Command + P Open the command palette
Command + Shift + O Control + Shift + O Command + Shift + O Show the project list, to switch projects or open a folder
Command + Comma Control + Comma Command + Comma Open preferences
Command + 1 Control + 1 Command + 1 Toggle the left sidebar
Command + 2 Control + 2 Command + 2 Toggle the frontmatter panel
Command + 0 Control + 0 Command + 0 Focus the main editor
Control + Command + F F11 Control + Command + F Toggle full screen

These shortcuts work when the editor is focused.

Shortcut Action
Command + B Control + B Command + B Toggle bold
Command + I Control + I Command + I Toggle italic
Command + K Control + K Command + K Insert or edit a link
Command + Shift + K Control + Shift + K Command + Shift + K Open the Content Finder
Command + Slash Control + Slash Command + Slash Insert MDX component (in .mdx files) or toggle comment

These operate on the line or paragraph under the cursor.

Shortcut Action
Option + Command + 1 Alt + Control + 1 Option + Command + 1 Heading 1
Option + Command + 2 Alt + Control + 2 Option + Command + 2 Heading 2
Option + Command + 3 Alt + Control + 3 Option + Command + 3 Heading 3
Option + Command + 4 Alt + Control + 4 Option + Command + 4 Heading 4
Option + Command + 0 Alt + Control + 0 Option + Command + 0 Remove heading (plain paragraph)
Shortcut Action
Command + Shift + F Control + Shift + F Command + Shift + F Toggle focus mode
Command + Shift + T Control + Shift + T Command + Shift + T Toggle typewriter mode

These handle find and replace within the current document.

Shortcut Action
Command + F Control + F Command + F Open search
Command + G Control + G Command + G Find next match
Command + Shift + G Control + Shift + G Command + Shift + G Find previous match
Enter Enter Enter / Shift + Enter Shift + Enter Shift + Enter Find next / previous (while the search field is focused)
Escape Escape Escape Close the search panel
Shortcut Action
Command + Z Control + Z Command + Z Undo
Command + Shift + Z Control + Shift + Z Command + Shift + Z Redo
Command + Right Square Bracket Control + Right Square Bracket Command + Right Square Bracket Indent
Command + Left Square Bracket Control + Left Square Bracket Command + Left Square Bracket Dedent
Command + A Control + A Command + A Select all
Command + D Control + D Command + D Select next occurrence of the selection
Command + Shift + L Control + Shift + L Command + Shift + L Add cursors to selected line ends
Command + Option + G Control + Alt + G Command + Option + G Go to line
Tab Tab Tab Insert tab or jump to next snippet field
Shift + Tab Shift + Tab Shift + Tab Jump to previous snippet field
Action Effect
Option Alt Option + hover over image path Preview the image
Option Alt Option + click a URL Open the URL in your browser
Command Control Command + click Add another cursor

These shortcuts work when the component builder dialog is open.

Shortcut Action
Enter Enter Enter Open the selected component’s form
Command + Enter Control + Enter Command + Enter Insert the component (in its form)
Escape Escape Escape Go back to the component list from a form, or close the builder from the list

These shortcuts work when the project list is open.

Shortcut Action
Enter Enter Enter Open the highlighted project
Command + O Control + O Command + O Open Folder…, to open a project for the first time
Command + Backspace Control + Backspace Command + Backspace Remove the highlighted project from Astro Editor, after asking. The open project can’t be removed

These shortcuts work when the Content Finder dialog is open.

Shortcut Action
Enter Enter Enter Open the selected file
Command + Enter Control + Enter Command + Enter Insert a link to the selected file