Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Sort HTML attributesNew to Visual Studio Code? Get it now.
Sort HTML attributes

Sort HTML attributes

Raphaël Balet

|
7,729 installs
| (2) | Free
Sorting the tag attributes in the specified order
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sorting HTML attributes

Sorting of the tag attributes in the specified order.

HTML

2016-03-03_16-23-34

Donate

If you want to thank me, thanks this guy instead mrmlnc, this plugin is a copy of that with a few update.

Install

  • Press F1 and select Extensions: Install Extensions.
  • Search for and select attrs-sorter.

See the extension installation guide for details.

Usage

  • You can use global keyboard shortcut ALT+SHIFT+F or right-click context menu Format code.
  • Or press F1 and run the command named Sorting HTML tag attributes (attrs-sorter).

Supported languages

  • HTML (+ HTML like languages)
  • Jade (+ Pug)

Supported settings

attrsSorter.order

  • Type: string[]
  • Default: http://codeguide.co/#html-attribute-order

An array of attributes in the correct order. See posthtml-attrs-sorter#order for more details.

For example:

{
	"attrsSorter.order": ["data-.+", "aria-.+", "class"]
}

Keyboard shortcuts

For changes keyboard shortcuts, create a new rule in File -> Preferences -> Keyboard Shortcuts:

{
	"key": "ctrl+shift+c",
	"command": "attrsSorter.execute"
}

Changelog

See the Releases section of our GitHub project for changelogs for each release version.

License

This software is released under the terms of the MIT license.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft