Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>openHAB Config Aligner 2026New to Visual Studio Code? Get it now.
openHAB Config Aligner 2026

openHAB Config Aligner 2026

Manuel Miethe

|
2 installs
| (0) | Free
| Sponsor
Community-maintained config alignment and formatting tool for openHAB item and sitemap files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info


Visual Studio Marketplace Installs Visual Studio Marketplace Version Visual Studio Marketplace Version

Support & Credits

If this maintained fork helps you, please consider supporting the ongoing maintenance:

  • ☕ Buy Manuel Miethe a coffee

This extension is a maintained community fork of the original openHAB Alignment Tool by Maximilian Beckenbauer. If you want to thank the original developer as well:

  • 💙 PayPal donation for Maximilian Beckenbauer, the original developer

This extension adds support for formatting and indenting openHAB files like *.items, *.sitemap, etc. At the moment only *.items and *.sitemap files are supported. They can be formatted in a column channel-column or multiline style. In the future the other file types and other format-types will be added. Feel free to add feature-requests on the github repository.

Maintained Fork / Fixed Bug

This 2026 maintained fork includes the upstream fixes and adds a fix for item channel binding configurations where curly braces inside quoted strings could break formatting. Example affected cases are channel parameters that contain JSON-like values or text with {...} inside quotes.

It also corrects space-based column padding when editor.insertSpaces is enabled, so aligned columns stay consistent with the configured tab size.

Features

The tool is available as a standard Visual-Studio-Code formatter as it uses the original vsc formatter API. You can force to formatting with right-clicking the document and clicking Format Document... or Format Selection.... If you have enabled the function in the vsc settings it even can Format-On-Save.

Item-Formatting:

Column-Style:

formatting item gif

Column-Channel-Style:

formatting item gif

Multiline-Style:

formatting item gif

Sitemap-Formatting:

formatting sitemap gif

Special Comment Tags

With the new version (v2) of this extension there are introduced new Special Comment Tags you can use in your `.items file code, to change the way the extension is formatting your code.

New Group Tag

// #OHNG#

With this tag you can start a new formatting group for an item section. The tracking of the longest item parts is resetted and will be set to the longest item part in the new group. The following image shows an example of a formatting group:

new formatting group

New Formatting Style

// #OHFS#%FORMATTING_STYLE%#OHFS#

With this tag you can change the formatting of the following item definitions from the default formatting style selected in the VSC settings to a new style inserted in %FORMATTING_STYLE%. So just replace %FORMATTING_STYLE% with Column, ChannelColumn or Multiline. The following image shows an example of a Multiline formatted part in a ChannelColumn document:

new formatting style

Limitations

The formatting is available for the following openhab file types:

  • .items (Fully functional)
  • .sitemap (Under development)
  • .things (Under development)

Extension Settings

New Line After Item

With this option you can choose if you want to have a new line inserted after each item. If there is already a single empty line after an item this settings is ignored.

"openhab-config-aligner-2026.newLineAfterItem": true

Preserve Whitespace

Whitespaces (tabs or spaces) in front of items get preserved and won't be deleted.

"openhab-config-aligner-2026.preserveWhitespace": true

Multiline Indent Amount

With this option you can control the amount of indent when using the Multiline format.

"openhab-config-aligner-2026.multilineIndentAmount": 28

Format Style

The format style option gives you two styles between you can choose.

  • Column
  • ChannelColumn
  • Multiline

The Column style formats the files in a column-way. Each item will be on one line and the item parts are separated in columns. With the ChannelColumn style only the channel part of an item gets formatted into multiple lines. The Multiline format prints every part of an item in a new line and indents the different parts.

Known Issues

See Github Issues file for the details.

Release Notes

See CHANGELOG.md file for the details.


For More Information

  • openHAB Documentation
  • openHAB Community

Enjoy!

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