How To Enable Auto Format On Save in VS Code?

Whenever we write some code in our Visual Studio Code, we have to spend our precious time formatting the code for better readability and understanding. Any code with poor formatting is hard to understand and debug. Proper positioning of curly brackets and indentation is very important because it helps us to understand which part of the code is ending where.

It is okay to format a few lines of code manually but imagine if we are writing 1000 lines of code and we are spending a lot of our time in formating them correctly. But many Visual Studio Code users don't know about the auto-formatting feature that is available in VS Code. 

Today we are going to save a lot of your precious time by letting you know how you can enable this feature on VS Code. 

Step 1: Open your Visual Studio Code and click on the Settings icon from the lower-left corner and then select Settings.

Enable auto format code

Step 2: Now, inside the User section, select Text Editors and expand this section. You can see a setting option name "Formatting" select that option.

step 2 of Auto Formatting Code in VS Code

Step 3: Inside Formatting, select the check box with the name "Format On Save" and that's it. 

Step 3 of Auto Formatting Code in VS Code

Now you will observe that whenever you write and piece of code and click on Save, your code will automatically get formatted. Now you just enjoy writing beautiful code without worrying about formatting them. 

⚡ Please share your valuable feedback and suggestion in the comment section below or you can send us an email on our offical email id ✉ algolesson@gmail.com. You can also support our work by buying a cup of coffee ☕ for us.

Similar Posts

No comments:

Post a Comment


CLOSE ADS
CLOSE ADS