Neovim support for _hyperscript, the small scripting language for the web. This plugin provides tree-sitter–powered syntax highlighting for ._hs files and injects highlighting into _hyperscript embedded in HTML, the _="…" attributes you write on elements.
It ships the tree-sitter-hyperscript grammar, builds it on install, and loads it through Neovim's built-in tree-sitter support.
- Syntax highlighting for
._hsfiles. - Injection into HTML:
_,script, anddata-scriptattributes, plus<script type="text/hyperscript">blocks. - Zero runtime dependencies — the parser and queries are bundled and compiled at install time.
- Optional: teaches the HTML language server that
_is a valid attribute, so it stops reportinginvalid_attron your _hyperscript.
- Neovim
0.10or newer (built-in tree-sitter). - A C compiler (
cc,gcc, orclang) andmakeon yourPATHused once at install time, to compile the parser.
No tree-sitter CLI, no Node, no nvim-treesitter.
{
'ignamartinoli/_hyperscript.nvim',
build = 'make',
ft = { 'hyperscript', 'html' },
opts = true
}That's the whole setup. build = "make" compiles the bundled grammar into a parser on install and whenever you run :Lazy build _hyperscript.nvim.
The plugin has no Lua dependencies; any manager works as long as it runs make as the build step and fetches submodules (the grammar is vendored as one). Then call require("_hyperscript").setup() yourself.
Open a ._hs file and highlighting is on. Open an HTML file and _hyperscript inside attributes is highlighted too:
<button _="on click toggle .red then wait 2s then remove me">
Click me
</button>No highlighting in ._hs files. Check the parser built:
:lua =vim.api.nvim_get_runtime_file("parser/hyperscript.so", false)If that's empty, the build didn't run. Run :Lazy build _hyperscript.nvim
(or make in the plugin directory) and read the output — the usual cause is a
missing C compiler or make.
No highlighting in HTML attributes. Confirm the HTML parser is present
(injection needs the host parser) and that the plugin loaded — it must load for
the html filetype, which the ft list above ensures.
HTML LSP reports invalid_attr on _. Make sure html_lsp is enabled
(default). If your HTML language server only reads custom data from
init_options at startup, run :LspRestart once after first install.
- _hyperscript — the language.
tree-sitter-hyperscript— the grammar this plugin bundles.
MIT