Configuring Zed editor to use HTML Beautifier as a formatter in ERB templates

Following on from my previous post about configuring Zed editor to use ERB Lint as a formatter, here's how to configure Zed to use Paul's excellent HTML Beautifier as a formatter in ERB templates.

Configure HTML Beautifier as a formatter for ERB files as well as HTML files by adding the following JSON to your Zed settings, either global or project-specific:

  
    {
      "languages": {
        "ERB": {
          "formatter": [
            {
              "external": {
                "command": "bundle",
                "arguments": ["exec", "htmlbeautifier", "--keep-blank-lines", "1"]
              }
            }
          ]
        },
        "HTML": {
          "formatter": [
            {
              "external": {
                "command": "bundle",
                "arguments": ["exec", "htmlbeautifier", "--keep-blank-lines", "1"]
              }
            }
          ]
        }
      }
    }
  

Note that I've added the HTML Beautifier formatter configuration after the ERB Lint formatter configuration for ERB files and that seems to work well.