- Instant help with your Developer coding problems

Format code in VS Code

Question:
How to format code in VS Code?
Answer:
// Format entire file
SHIFT + ALT + F

// Format only selection
CTRL + K CTRL + F
Description:

In Visual Studio Code there are multiple ways to format your code in the editor. If you want to format the entire file use the keyboard shortcut: SHIFT + ALT + F . Alternatively, you can use the context menu. Right-click in the editor and select the Format Document option.

If you want to format only a part of the document then select the relevant lines and use the keyboard shortcut CTRL + K CTRL + F or as before select the Format Selection from the context menu.

Share "How to format code in VS Code?"