[vim/vim] Update svelte.vim to extend html.vim and add htmx and alpine.js support to html.vim. (PR #21326)

7 views
Skip to first unread message

231tr0n

unread,
Sep 16, 2026, 3:07:17 PM (5 days ago) Sep 16
to vim/vim, Subscribed

This PR modifies html.vim so that it can be extended by all the other html templating languages by using generic regex for tag matching/attribute matching. Also support for htmx and alpine.js is added to html.vim and svelte.vim is modified to use the extended html.vim.

FYI: I used opencode to program this patch and am fully aware of the code being commited.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21326

Commit Summary

  • 84f8c8e fix: make svelte extend html runtime and fix all issues with html and add support for alpine.js and htmx
  • 08c1636 Merge branch 'vim:master' into master
  • afe4995 fix: fix typo
  • e4f9442 fix: fix more issues with svelte/html
  • 675346b fix: fix more issues with svelte/html
  • 074e0bb Merge branch 'vim:master' into master

File Changes

(14 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21326@github.com>

dkearns

unread,
Sep 17, 2026, 11:38:44 PM (3 days ago) Sep 17
to vim/vim, Subscribed
dkearns left a comment (vim/vim#21326)

Sorry, I had the impression the svelte syntax file, having been merged, was probably considered resolved.

Yes, as @chrisbra says this is the wrong approach. Matching the shape of an HTML syntax file isn't nearly as useful as matching the specifics and changing tthirty year old behaviour will annoy lots of users.

I'm aware html.vim is at least a little out of date. I took it over a couple of years ago because it was abandoned and haven't done much with it yet as it rarely attracts any bug reports. Squeaky wheels and all that...

I haven't looked at the details of this PR but in principle we shouldn't be adding anything to this file besides generic capabilities that make extension easier. Template syntax files should include the html syntax and extend it.

Perhaps it would be better to provide the simplest example of a file that doesn't work with a description of the desired result.

I also noticed that the recently merged svelte additions to the JavaScript syntax file also take the wrong approach. That file, ideally, shouldn't need to know anything about svelte.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21326/c5724790382@github.com>

231tr0n

unread,
Sep 18, 2026, 6:58:05 AM (3 days ago) Sep 18
to vim/vim, Subscribed
231tr0n left a comment (vim/vim#21326)

I also noticed that the recently merged svelte additions to the JavaScript syntax file also take the wrong approach. That file, ideally, shouldn't need to know anything about svelte.

The svelte.js/ts files are standard js/ts files but with special functions for runes which start with $ symbol. So, I believe that is the right place for them to go. The other way would be to create new filetype for specifically svelte.js/ts and add this one condition while extending js/ts files which basically will be the only content in those newly created filetypes.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21326/c5729011513@github.com>

Reply all
Reply to author
Forward
0 new messages