Skip to content

Using Herb with Sublime Text ​

Configure the Herb Language Server with Sublime Text (via Sublime LSP) for HTML+ERB development.

Herb with Sublime Text

Installation ​

These instructions assume that you have already installed Sublime LSP

Manual Configuration ​

First, install the Herb Language Server globally:

bash
npm install -g @herb-tools/language-server
bash
yarn global add @herb-tools/language-server
bash
yarn dlx -q @herb-tools/language-server --stdio
bash
pnpm add -g @herb-tools/language-server
bash
bun add -g @herb-tools/language-server

Then add the herb client via the LSP package preferences:

json
// LSP.sublime-settings
{
  "clients": {
    "herb": {
      "enabled": true,
      "command": [
        "herb-language-server",
        "--stdio"
      ],
      "selector": "text.html.ruby | text.html.rails",
      "settings": {
        "languageServerHerb.linter": {
          "enabled": true
        }
      },
      "initializationOptions": {
        "enabledFeatures": {
          "diagnostics": true,
        },
        "experimentalFeaturesEnabled": true
      }
    }
  },
}

Troubleshooting ​

Ensure the language server is in your PATH:

bash
which herb-language-server

Check your LSP client's documentation for debugging commands.

Other editors ​

If you are looking to use Herb in another editor, check out the instructions on the editor integrations page.

Released under the MIT License.