Skip to content

Handlebars + Glimmer syntax support#19569

Open
sukima wants to merge 2 commits intovim:masterfrom
sukima:handlebars-glimmer-syntax
Open

Handlebars + Glimmer syntax support#19569
sukima wants to merge 2 commits intovim:masterfrom
sukima:handlebars-glimmer-syntax

Conversation

@sukima
Copy link
Contributor

@sukima sukima commented Mar 3, 2026

This PR adds syntax highlighting and indentation support for Handlebars (*.hbs) templates and Glimmer (*.gjs/*.gts) files. While Vim already detected these filetypes, it lacked the syntax and indentation definitions needed for proper editing.

Changes:

  1. Handlebars Support:

    • Added new runtime/syntax/handlebars.vim with syntax highlighting for Handlebars templates
    • Added new runtime/indent/handlebars.vim with better indentation rules for Handlebars
  2. Glimmer Support:

    • Added new runtime/syntax/glimmer.vim that combines JavaScript/TypeScript syntax with Handlebars syntax
    • Properly handles <template> blocks within Glimmer files

The Handlebars code is adapted from an external project with permission from the original author under the MIT license (properly attributed in both files). This enhances Vim's support for Ember.js and other frameworks that use these template formats.

sukima added 2 commits March 3, 2026 16:15
The runtime had support to detect handlebars (*.hbs) files as filetype
handlebars but was lacking any indent or syntax highlighting for that
filetype.

The handlebars syntax file is also a prerequisite for the glimmer
syntax.

Permission was granted by the original author to retrofit these into the
Vim runtime. Original License (MIT) maintained in code comments.
In commit cdf7172 ("patch 8.2.4424: ".gts" and ".gjs" files are not
recognized", 2022-02-19) support for the glimmer file types were added.

Problem:  Syntax hilighting suppoprt was missing.
Solution: Added a glimmer syntax file that will leverage the base
          syntaxs (javascript/typescript) and include handlebars syntax
          for .gjs/.gts files.
@sukima sukima force-pushed the handlebars-glimmer-syntax branch from 08d4810 to 8636c41 Compare March 3, 2026 21:15
@sukima
Copy link
Contributor Author

sukima commented Mar 3, 2026

I am unable to understand the current test failures. They appear to be network issues concerning Linux OS packages unrelated to the runtime files added in this PR?

Please advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant