Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Format HTML code in IntelliJ

When working with Java, Ctrl+Alt+L formats your highlighted code. Is there such a command when working with non-Java files like HTML? The same command doesn't work with HTML.

like image 350
Francis Ting Avatar asked Aug 28 '26 19:08

Francis Ting


2 Answers

In Ultimate edition same keys (Ctrl+Alt+L) works for HTML as well. I suppose, community Edition doesn't support it out of the box.

Check settings: Settings -> Editor -> Code Style -> HTML (If it is not present, try to install some plugins for HTML support)

like image 184
Dmytro Marchenko Avatar answered Sep 01 '26 18:09

Dmytro Marchenko


For Mac

Use Option+Command+L for Formatting HTML files.

You can check/customize it using: command+, for a search for Reformat Code.

like image 39
Paulo Victor Avatar answered Sep 01 '26 20:09

Paulo Victor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!