Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format file in Visual Studio Code (hotkeys)?

How to format file | project folder | all project files (using hot keys AND using menu) in Visual Studio Code?

like image 421
Sergii Avatar asked Jul 08 '17 14:07

Sergii


People also ask

What is the shortcut to format code in Visual Studio?

In an existing project, open the document that you want to format, right-click inside the document, and select Format Document. In the default configuration for Visual Studio Code, the command can be run using the shortcut Alt+Shift+F.

How do I format in Visual Studio?

Click menu Edit → Advanced → *Format Selection, or press Ctrl + K , Ctrl + F .


2 Answers

If you're on Windows use Shift + Alt + F to make your code "pretty".

(This is similar to Ctrl + K + D in Visual Studio)

You will have to do this for each individual file though. I don't know of a way to format all files at once.

like image 175
nick Avatar answered Nov 11 '22 07:11

nick


Try with this hotkeys

Ctrl + Shift + i
like image 42
alehn96 Avatar answered Nov 11 '22 07:11

alehn96