Brackets.io: Is there a way to auto indent / format <html>

FormatAdobe BracketsAuto Indent

Format Problem Overview


I am new to Brackets.io and thought I saw a shortcut key to auto indent/format HTML, however I cannot find a shortcut. Is there a shortcut or add-on that will do this for me?

Format Solutions


Solution 1 - Format

I found an add-on for Brackets.io that uses auto-indent called Indentator.
It uses shortcut keys Ctrl + Alt + I

Solution 2 - Format

You can install an indentator package.

Click on File > Extension Manager....

Look for the search field and type: Indentator > Install

Once Indentator is installed, you can use Ctrl + Alt + I

Solution 3 - Format

Beautify does a good job. It provides a "Beautify on save" option, so that you may use ctrl+s to reformate html, less, css, etc

Solution 4 - Format

The shortcut key is ctrl+] to indentation and ctrl +[ to unindent

Solution 5 - Format

The Identator plugin works to me in Brackets Release 1.13 versión 1.13.0-17696 (release 49d29a8bc) on S.O. Windows 10

Solution 6 - Format

I've been playing around with the preferences and added the following to my brackets.json file (access in Menu Bar: Debug: "Open Preferences File").

"closeTags": {
    "dontCloseTags": ["br", "hr", "img", "input", "link", "meta", "area", "base", "col", "command", "embed", "keygen", "param", "source", "track", "wbr"],
    "indentTags": ["ul", "ol", "div", "section", "table", "tr"],
    }
  • dontCloseTags are tags such as <br> which shouldn't be closed.
  • indentTags are tags that you want to automatically create a new indented line - add more as needed!
  • (any tags that aren't in above arrays will self-close on the same line)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionZac SmithView Question on Stackoverflow
Solution 1 - FormatZac SmithView Answer on Stackoverflow
Solution 2 - FormatMachadoView Answer on Stackoverflow
Solution 3 - FormatSascha KluthView Answer on Stackoverflow
Solution 4 - FormatkevinView Answer on Stackoverflow
Solution 5 - Formatjavo_O-View Answer on Stackoverflow
Solution 6 - FormatJBallinView Answer on Stackoverflow