I love a lot about Visual Studio Code. But on my Mac it does not format coding. The way it handles indenting is very frustrating. Some code text editors allow you to select all your code and 'tidy' or 'reformat' it to fix any bad indenting, but Visual Studio Code doesn't appear to have any options for this. Can anyone provide any tips or solutions?
Asked
Active
Viewed 983 times
0
-
What files are you trying to format? There are extensions like prettier that will help with js files. – MjZac Feb 19 '19 at 04:52
-
a few things, but what I notice it on most is standard .html files – Auxiliary Joel Feb 19 '19 at 06:10
1 Answers
1
Navigate the menu: Code > Preferences > Keyboard Shortcuts. Search for "format".
The default for editor.action.formatDocument
is shift + option + F.
The default for editor.action.formatSelection
is command + K + F.
Here's a similar question with answers.

Matt
- 3,677
- 1
- 14
- 24