command to format code in vs code code example Example: format code in vs code On Windows Shift + Alt + F. On Mac Shift + Option + F.