Autocompletions for data-star HTML attributes in Neovim using blink.cmp.
- Neovim 0.11+
- blink.cmp v0.7.0+
- nvim-treesitter with HTML parser
{
'saghen/blink.cmp',
dependencies = {
'your-username/blink-cmp-data-star',
},
opts = {
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer', 'datastar' },
providers = {
datastar = {
name = 'data-star',
module = 'blink-cmp-data-star',
opts = {
enable_pro = false,
},
},
},
},
},
}providers = {
datastar = {
name = 'data-star',
module = 'blink-cmp-data-star',
opts = {
enable_pro = false, -- Enable Datastar Pro attributes (default: false)
trigger_chars = { '-', '_' }, -- Override trigger characters
},
score_offset = 5, -- Boost ranking in completion menu
},
}- Open an HTML file (or supported template: Vue, Svelte, ERB, etc.)
- Type
data-inside an HTML tag to see attribute completions - Type
@inside attribute values to see action keyword completions
<div data-█
^^^^^ Triggers autocomplete showing all 21 core attributes<button data-on-click="@█">
^^ Triggers autocomplete showing action keywordshtml,htmvue,sveltehtmldjango,jinjaeruby,erbblade
MIT