Skip to content

Zed

Zed bundles tree-sitter natively and has a clean LSP extension story. The httui-lang Zed extension wires both up.

  1. Open Zed.
  2. Cmd+Shift+X → Extensions panel.
  3. Search “httui”.
  4. Install httui-lang.

The extension auto-installs the tree-sitter parser + downloads the httui-lsp binary on first use.

Zed reads .zed/settings.json per project (your vault) and ~/.config/zed/settings.json globally.

{
"lsp": {
"httui-lsp": {
"binary": {
"path": "httui-lsp",
"arguments": []
},
"settings": {
"httui": {
"env": "staging"
}
}
}
},
"languages": {
"httui": {
"tab_size": 2,
"format_on_save": "off",
"formatter": "language_server"
}
}
}

The extension registers:

  • *.httui → language httui
  • *.md → markdown (httui injects into fenced code blocks)

For the markdown injection to work, Zed needs the tree-sitter markdown grammar (built-in) + httui’s injection queries (ship with the extension). No extra config.

FeatureHow to use
Syntax highlightAutomatic on file open
HoverMouse over {{ref}} (Zed default K in vim mode)
Go to definitionF12 / Cmd+Click
Find referencesShift+F12
RenameF2
Code actionsCmd+.
Format documentCmd+Shift+I
Workspace symbolsCmd+T

Set per-vault in .zed/settings.json:

{
"lsp": {
"httui-lsp": {
"settings": { "httui": { "env": "staging" } }
}
}
}

Or globally if you mostly work on one env. To switch on the fly:

Cmd+Shift+P“httui: Set active environment”.

If the httui desktop app is running on the same vault, Zed shows a “Run” lens above each block. Click it → the LSP sends httui/blockRun to the desktop, which executes and returns the result inline (rendered in a small panel below the block via Zed’s inline UI).

Without the desktop running, the lens shows “Run in TUI →” — clicking opens a terminal split with httui-tui run <file>.

httui-lang ships with token mappings that respect Zed themes:

httui nodeZed token (default)
(verb)keyword
(alias_ref ident)function
(env_ref ident)constant
(field) @assertionvariable.special
(literal) @assertionstring
(reference) (whole)embedded

Custom themes pick these up automatically. To override, in settings.json:

{
"experimental.theme_overrides": {
"syntax": {
"function": { "color": "#84B5FF" },
"constant": { "color": "#FFCC66" }
}
}
}

Zed reads .zed/snippets/httui.json per-project:

{
"HTTP block": {
"prefix": "http",
"body": [
"http alias=$1",
"${2:GET} ${3:https://example.com/path}",
"${4:Accept: application/json}",
"$0"
]
},
"HTTP with expect": {
"prefix": "httpexpect",
"body": [
"http alias=$1",
"${2:GET} ${3:https://example.com/path}",
"",
"# expect:",
"# status == 200",
"$0"
]
},
"DB block": {
"prefix": "db",
"body": [
"db-${1:local}",
"SELECT $0"
]
}
}

The extension downloads httui-lsp from GitHub Releases on first use. If offline / blocked:

Terminal window
cargo install httui-lsp

Then set the path explicitly:

{ "lsp": { "httui-lsp": { "binary": { "path": "/Users/you/.cargo/bin/httui-lsp" } } } }

Check Zed’s tree-sitter playground:

Cmd+Shift+P“editor: open tree-sitter playground”.

Open a .md runbook with httui fences. The tree should show the http / db-* regions parsed by httui. If not, reinstall the extension.

Reload the LSP:

Cmd+Shift+P“editor: restart language server”.