Technology

How do i format or beautify code in Visual Studio code?

How do i format or beautify code in Visual Studio code?;-If  You have just started using Visual Studio code, but not able to format code in it, You have tried ctrl k+ Ctrl d but it doesn’t work, any helpful link for it?

format or beautify code in Visual Studio code

Formatting Code in Visual Studio can be done using the Keyboard shortcuts as below

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

you can also find these as well as other shortcuts, through the search functionality provided in the editor with Ctrl +ShiftP (or Command + Shift + P on Mac), and then search for format document.

Source

For Php developer, if you are working on php you should download php extension format code.

Press F1 and type : ext install PHP Code Format .

Then Shift + Alt + F will work

You can add a keybinding in Preferences –> Keyboard shortcuts.

{ "key": "cmd+k cmd+d", "command": "editor.action.formatDocument" }

Or Visual Studio like:

{ "key": "ctrl+k ctrl+d", "command": "editor.action.formatDocument" }

 

About the author

Avatar Of Allglobalupdates

allglobalupdates

All global Updates was established in 2017, and since then we have developed into a renowned group of passionate Content Creators. We concentrate on newsworthy topics in the fields of Finance, Tech, education, Business, Careers, entertainment, and sports. We also create captivating human interest stories and informative content.

Leave a Comment