Tricks and tips for VSCode Beginners

Komal Khetlani
Dev Genius
Published in
3 min readJul 9, 2020

--

I believe you have just begun your programming journey. You have got your VSCode installed and you are ready to get started.

Let me share with you some tricks that will make your life super easy when using VSCode 😃

  1. How to run an HTML file in VSCode?

I am sure everyone who gets started with VSCode has googled this question once in their life. That’s because there is no direct option available in the navbar by default. Let me tell you how you can do it in a quick manner 😋

Click on the Extensions options in the vertical nav bar on the side. Search for Open in Browser extension. Tadaaa… just install it and you are good to go. Post this, just click Alt+B on the keyboard to run the file in the browser. Now, you can also right-click on the file, to get an option to open in the browser.

The extension is already installed in my VSCode.

2. How to change the theme of the VSCode?

Visual Studio Code provides a lot of colour themes like Light, Abyss, Red, Dark, Solarized Dark and many more. To select and change the colour theme, just click on the File ->Preferences->Color Theme. You will land up with a lot of options. Just choose one of your choices and customize your IDE.

3. How to comment a block of your code in VSCode?

It’s very important to know how to comment a block of code. Commenting codes line by line is a tedious process. In VSCode, you can comment your selected code by just Ctr+/ command.

4. Format your code!

Unformatted code looks messy and unprofessional. VSCode provides a very easy way to format your code. You have an option to format the entire document or just a section of the code. Shift + Alt + F will help you format your entire document. You can also select the code and right-click to get the format code option.

Just look at the difference between how both of them look and feel!

Happy Coding 💻

--

--