Welcome to datastar.nvim — IDE-quality Datastar support for Neovim.
Datastar is a hypermedia framework that brings reactivity to HTML using data-* attributes. Instead of writing JavaScript components, you declare behavior directly in your markup:
<div data-signals:count="0">
<button data-on:click="$count++">+1</button>
<span data-text="$count"></span>
</div>This plugin gives you completions, hover docs, diagnostics, and navigation for all Datastar attributes — right inside Neovim.
- Neovim ≥ 0.9 (0.10+ recommended)
- Treesitter HTML parser:
TSInstall html
Optional (for enhanced completions):
{
"WillEhrendreich/datastar.nvim",
ft = { "html" }, -- add "templ" if using the Templ Go templating language: ft = { "html", "templ" }
opts = {},
}That's it. The plugin activates automatically for HTML files.
use {
"WillEhrendreich/datastar.nvim",
config = function()
require("datastar").setup()
end,
ft = { "html" }, -- add "templ" if using the Templ Go templating language: ft = { "html", "templ" }
}Clone to your Neovim packages directory:
git clone https://github.com/WillEhrendreich/datastar.nvim \
~/.local/share/nvim/site/pack/plugins/start/datastar.nvimAdd to your init.lua:
require("datastar").setup()Run :checkhealth datastar — you should see all green checks:
datastar: health#datastar#check
========================================
- OK Neovim version: 0.10.x
- OK Treesitter HTML parser installed
- OK Plugin configured successfully
- OK Datastar schema loaded: 31 plugins
- OK Completion engine: omnifunc registered
- Open any
.htmlfile - Type
data-inside an HTML tag - A completion menu appears with all Datastar attributes
- Select one and keep typing — modifiers, keys, and values all complete contextually
- Completions Guide — all 5 completion contexts explained
- Diagnostics — real-time error detection
- Navigation — goto definition, signal graph
- Configuration — all options
- Integrations — nvim-cmp, blink.cmp setup