Setting up Visual Studio Code

Setting up Visual Studio Code

My current preferred code editor is Visual Studio Code. In this article I will share some of my favourite extensions to customise the editor.

The first extension is called Prettier - Code formatter. This is a very popular extension which automatically formats your code whenever you save it. Well formatted code helps you easily find and fix mistakes in your code.

After installing the extension, select the settings icon in VS Code to tweak a couple of settings. First set the VS code Default formatter to Prettier:

Screen Shot 2021-10-12 at 23.00.39.png

So now VS code knows to use prettier to format your code, you next need to configure VS code to format your code when saving your file. Again in the settings, search for Format on save and make sure this option is checked:

Screen Shot 2021-10-12 at 23.07.45.png

Next search for auto save and select the option onFocusChanged to automatically save your files.

You may also like to change the colour theme of VS code. A colour theme I like to use is called One Monokai .

I also like to set my file icon theme to Material Icon Theme .

Another essential extension is Live Server.

If you like the look of your code, you'll probably enjoy writing it more.