55

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?

Zac Smith
  • 1,919
  • 1
  • 13
  • 17

6 Answers6

82

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

TheChilliPL
  • 337
  • 1
  • 5
  • 14
Zac Smith
  • 1,919
  • 1
  • 13
  • 17
  • 6
    Did you install the Indentator add-on? I just confirmed it works well on the current version of Brackets (1.8). First go to File > Extension Manager and search for Indentator. Upon completion of installation, use Crtl + Alt + i and it should work without issue. – Zac Smith Nov 15 '16 at 21:45
  • This works fine, but only on the whole file, not on the selected code only – gevra Jan 25 '17 at 02:30
  • For macOS the shortcut is Ctrl + Option + I. – malajisi Aug 08 '18 at 09:01
  • The author clearly missed the chance to name it as the **Indent-inator** (you read it in Doof's voice, didn't ya?) ;) – varun Aug 26 '19 at 09:02
59

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

Machado
  • 8,965
  • 6
  • 43
  • 46
29

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

Sascha
  • 1,156
  • 9
  • 13
2

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

kevin
  • 21
  • 2
1

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

javo_O-
  • 11
  • 1
0

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)
JBallin
  • 8,481
  • 4
  • 46
  • 51