elixir-tools.nvim icon indicating copy to clipboard operation
elixir-tools.nvim copied to clipboard

Otter.nvim Integration for ~H Heex support?

Open zolrath opened this issue 2 years ago • 4 comments
trafficstars

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!

zolrath avatar May 29 '23 17:05 zolrath

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!

mhanberg avatar May 29 '23 20:05 mhanberg

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.

zolrath avatar May 30 '23 00:05 zolrath

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"))`

pauloffborba avatar Jul 06 '23 10:07 pauloffborba

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

mhanberg avatar Jul 06 '23 12:07 mhanberg