Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beautify on save in VS code?

Tags:

I just installed a beautify extension for vs code

I want to have my code beautified whenever I save a file, but can't figure out how to configure it that way.

It says

Beautify on save will be enabled when "editor.formatOnSave" is true.

But i have no idea where to put it exactly as I cannot find the default option in any of the files.

I'm trying to switch to VS code and figure things out.

like image 751
UC3D Avatar asked Apr 11 '18 09:04

UC3D


Video Answer


2 Answers

For Windows click on 'File' -> Preferences -> Settings. Then search for editor.formatOnSave, and put "true" instead of "false"

For Mac click on 'Code' (top left of screen, to the left of 'File', 'Edit', and 'View') -> Preferences -> Settings -> enter the term 'editor.formatOnSave' in the search settings box at the top of the page. Click on the tick to mark it as true.

enter image description here

like image 76
Dave Anders Avatar answered Sep 18 '22 18:09

Dave Anders


Go to file--> preferences --> settings

In search type formatter and in default formatter select : prettier code formatter as shown in below screenshot.

enter image description here

like image 40
Vivek Singh Avatar answered Sep 19 '22 18:09

Vivek Singh