Zed editor support for djot, a modern light markup language created by John MacFarlane.
Syntax highlighting tuned to the php-collective/djot-php parser feature set. Paired with the djot-watch CLI, you get a complete write-and-preview loop without leaving Zed.
- Tree-sitter highlighting for the full djot spec (headings, emphasis, strong, links, images, lists, tables, divs, math, footnotes, attributes, smart typography).
- Code-block language injections — fenced
``` phpblocks get PHP highlighting,``` rustgets Rust, and so on. - YAML highlighting inside
---frontmatter blocks. - LaTeX highlighting inside
$...$and$$...$$math. - Bracket matching, autoclose pairs (
[],(),{},*,_,`). - Outline view shows your document's heading structure.
- Block-comment toggle uses djot's
{% %}form.
The extension is not yet in Zed's official registry. Install it as a dev extension:
- Clone this repo:
git clone https://github.com/php-collective/zed-djot.git
- In Zed, open the command palette (
Cmd/Ctrl+Shift+P) and runzed: install dev extension. - Select the cloned
zed-djotfolder.
Zed will fetch the upstream Tree-sitter grammar from Codeberg on first install. Subsequent installs use the cached grammar.
To verify the install, open any .djot file — headings, emphasis, and code blocks should be colored.
Pair this extension with vendor/bin/djot-watch from php-collective/djot for live HTML preview in your browser.
After composer require php-collective/djot, add this to your project's .zed/tasks.json for one-key preview:
[
{
"label": "Djot: Watch current file",
"command": "vendor/bin/djot-watch",
"args": ["$ZED_FILE"],
"cwd": "$ZED_WORKTREE_ROOT",
"use_new_terminal": true,
"allow_concurrent_runs": false
}
]Then Ctrl+Shift+P → task: spawn → pick the task. A browser tab opens at http://127.0.0.1:8765/ and live-reloads on every save.
- Submit to the Zed extension registry once the dev-extension period proves out.
- Icon-theme contribution for
.djotfiles in the file tree. - Coverage for djot-php-specific syntax (wikilinks
[[Page]], user mentions, abbreviation definitions*[KEY]:, fenced comments%%%) — pending upstream grammar PRs on codeberg.org/treeman/tree-sitter-djot.
- Jonas Hietala — the upstream
tree-sitter-djotgrammar. - nvim-treesitter — Tree-sitter query starting points.
- PHP Collective —
djot-phpparser anddjot-watchCLI.
MIT