Keyboard shortcuts to format Source code in Microsoft Visual Studio Code IDE


If you are new to Microsoft Visual Studio Code IDE (popularly called as VS Code) and wondering how to format or indent your source code, then here are the keyboard shortcuts that you can make use of,

For Windows:

If you are using VS Code on a device that runs Windows Operating System then the keyboard short cut is: Shift + Alt + F

For macOS:

If you are using VS Code on a device that runs Apple devices running macOS then the keyboard short cut is: Shift + Option + F

For macOS:

If you are using VS Code on a device that runs on Linux such as Ubuntu then the keyboard short cut is: Ctrl + Shift + I

⛏️ If you want to make use of your mouse, the simplest way to format your code is to right click anywhere in your source code file and select option - "Format Document", you can also check what the keyboard shortcut is by looking next to it just in case you forget it :)

This keyboard shortcuts remains the same irrespective of the programming language you are working on Java, JavaScript, Vue, Python etc.

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap