Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beautifly / Tidy (Javascript) in Visual Studio Code

I'm currently giving Visual Studio Code a try. Overall I like the user experience however I can't find some of the things I'm very much used to, in sublime (with the help of extensions.)

One of them is beautify code (or tidy up) - is there any way to do this for JavaScript in Visual Studio Code?

Any help is appreciated.

like image 328
Mia Avatar asked Aug 16 '15 18:08

Mia


2 Answers

If you want to beautify the code you can just press ctrl+shift+p and type format code or press alt+shift+f

It correctly indents my code so it seems like that is what you looking for, if not you might want to give an example.

like image 79
Dick van den Brink Avatar answered Oct 17 '22 08:10

Dick van den Brink


You can used the short code to beautify the code in Visual studio code

On Windows `Shift + Alt + F`
On Mac `Shift + Option + F`
On Ubuntu `Ctrl + Shift + I` 

As per the Programming language (PHP HTML Javascript ASP JSP etc )it will asked you to install a package, after installation you can use above short code.

like image 40
Avinash Raut Avatar answered Oct 17 '22 07:10

Avinash Raut