Skip to the main content

Visual Studio Code

Format the current file

ShiftAltF

Windows Desktop app Visual Studio Code default keymap

Practice this

In Visual Studio Code, Shift + Alt + F will format the current file. On a Mac, press Shift + Option + F instead.

Where it works: Formatter available

Before it works

  • A formatter must be installed for the current file type.

Every documented variant

Variants of this shortcut
System Environment Keys
Mac Desktop app ShiftOptionF
Windows Desktop app ShiftAltF

Where this comes from

Visual Studio Code key bindings

Documentation checked on 2026-09-11. That is a documentation review, not a test run inside the application.

Report a correction