Visual Studio Code: Formate and beautify PHP files and Laravel blade files with HTML markup on them (Formate the HTML)
The extension beautify just do it very well, either add php and any
other file extension type to the config as said above here is an example
:
OTHERWISE: you can also do it directly, type F1 then write beautify, the auto completion give you two choices beautify selection or beautify file. Choose the one you need, and it will do the job. that's a straight direct way.
You can also add a keybinding to have a keyboard shortcut, here how to do it:
note that all of those things are well documented on the description of the extension.
That was an answer for a thread in StackOverflow i have given, you can see that here:
https://stackoverflow.com/questions/41330707/how-to-format-php-files-with-html-markup-in-visual-studio-code/46855721#46855721
- go to user settings (CTRL + comma)
- search for beautify in the field above, and identify the line beautify.language, then click left in the pencil icon and click replace in settings. It will add the config to the right (user settings).
- for html section just add php and blade.php
OTHERWISE: you can also do it directly, type F1 then write beautify, the auto completion give you two choices beautify selection or beautify file. Choose the one you need, and it will do the job. that's a straight direct way.
You can also add a keybinding to have a keyboard shortcut, here how to do it:
- open keybindings.json (go file>preferences>keyboard shortcuts)
- click in above open and edit keybindings.json
- add the following into the closed brackets []
{
"key": "alt+b",
"command": "HookyQR.beautify",
"when": "editorFocus"
}
note that all of those things are well documented on the description of the extension.
That was an answer for a thread in StackOverflow i have given, you can see that here:
https://stackoverflow.com/questions/41330707/how-to-format-php-files-with-html-markup-in-visual-studio-code/46855721#46855721
Commentaires
Enregistrer un commentaire