Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Otter.nvim Integration for ~H Heex support? #101

Open
zolrath opened this issue May 29, 2023 · 4 comments
Open

Otter.nvim Integration for ~H Heex support? #101

zolrath opened this issue May 29, 2023 · 4 comments

Comments

@zolrath
Copy link
Contributor

zolrath commented May 29, 2023

Looking at otter.nvim (discussion here) it seems it scans for specific sections of your main languages buffer, in our case ~H"""<embedded language>"""", and allows you to use another language within it by synchronizing a hidden buffer.

It would be amazing to be able to comment out sections of the html in embedded heex like we can .heex files!

@mhanberg
Copy link
Collaborator

I think this might be already possible with a few lines of treesitter magic or with one of the more advanced comment plugins.

I'll look into it!

@zolrath
Copy link
Contributor Author

zolrath commented May 30, 2023

Sounds good, that would be nice regardless!

Another benefit of using something like otter would be snippets that target .heex would be able to trigger inside the ~H""" """ section. I have a number of html specific snippets that work in .heex files.

@pauloffborba
Copy link

pauloffborba commented Jul 6, 2023

Maybe this could help. I saw this config in the Svelte repo to understand their ~V sigil:

LiveSvelte

Neovim Treesitter Config
To enable syntax highlighting in Neovim with Treesitter, create the following file:

~/.config/nvim/after/queries/elixir/injections.scm

`; extends

; Svelte
(sigil
(sigil_name) @_sigil_name
(quoted_content) @svelte
(#eq? @_sigil_name "V"))`

@mhanberg
Copy link
Collaborator

mhanberg commented Jul 6, 2023

That already exists for the H sigil. It allows the highlighting of the snippet.

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

No branches or pull requests

3 participants