Skip to content

docs: html highlighting for nvim and helix - #51

Open
qvalentin wants to merge 1 commit into
masterfrom
docs/html-48
Open

qvalentin wants to merge 1 commit into
masterfrom
docs/html-48

Conversation

@qvalentin

Copy link
Copy Markdown
Collaborator

fixes #48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates documentation to help users enable HTML (and similar) language injection/highlighting when working with Go templates, with specific instructions for both NeoVim and Helix.

Changes:

  • Clarifies that users must add an injections query to get templated-language highlighting (e.g., HTML).
  • Adds editor-specific paths for NeoVim vs Helix query overrides.
  • Expands guidance around configuring filetype detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment on lines +58 to +59
Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`.

Copilot AI Mar 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instruction to install the injected language via :TSInstall is NeoVim-specific, but this section now also gives Helix instructions. Helix doesn't support :TSInstall, so this should be clarified/split (e.g., separate install guidance for NeoVim vs Helix) to avoid confusing Helix users.

Copilot uses AI. Check for mistakes.
Comment thread README.md
Replace html with the tree-sitter name of your required language and make sure to install it with `:TSInstall`.
Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`.

Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work.

Copilot AI Mar 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is unclear/likely incorrect: ft=gotmpl applies to Go template files, not "html" in general, and Helix language detection typically depends on its language config. Consider rewording to explicitly mention Go-template filetypes/extensions supported by this repo (tree-sitter.json lists gotmpl/gotexttmpl/gohtmltmpl) and how to map common extensions (e.g. .gohtml) in NeoVim/Helix.

Suggested change
Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work.
Then ensure filetype detection is working: in NeoVim, map your Go template files (for example `*.gotmpl`, `*.gotexttmpl`, `*.gohtml`) to `ft=gotmpl`; in Helix, configure these extensions to use the `gotmpl` language (the default `.gotmpl` association should already work).

Copilot uses AI. Check for mistakes.
Comment thread README.md
Replace html with the tree-sitter name of your required language and make sure to install it with `:TSInstall`.
Replace "html" with the tree-sitter name of your required language and make sure to install it with `:TSInstall`.

Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work.

Copilot AI Mar 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo: "fileextension" should be "file extension".

Suggested change
Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the fileextension .gotmpl should work.
Then ensure filetype detection is working, for html and NeoVim use ft=gotmpl, for Helix the file extension .gotmpl should work.

Copilot uses AI. Check for mistakes.
Comment thread README.md

For NeoVim edit `~/.config/nvim/queries/gotmpl/injections.scm`.
For Helix edit `~/.config/helix/runtime/queries/gotmpl/injections.scm`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the related Neovim Doc, might be a useful link to add in?: https://neovim.io/doc/user/treesitter/#treesitter-query-modeline-extends

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pretty please extend / support gohtml

3 participants