vim - Sigil highlighting (liveview)

I’m just working through the prag-prog live view course and discovered that my vim setup just isn’t working nicely for the .ex files where there’s an embedded sigil.

I have looked at other threads and I have configured treesitter (I believe!), but, the .html.heex and also the embedded sigil definitions just don’t look great see screenshot

Do I need to be using the nightly version of neovim (I’m on NVIM v0.10.0) as that was suggested?

If anyone has a working config shared somewhere I’d love to see it.

Many thanks!

[…] and I have configured treesitter (I believe!)

Can you share your config?

I don’t think you need 0.10. to highlight heex correctly, but I can’t verify because I am on 0.10 already.

For reference, I am using nvim-treesitter with the following config:

	{
		"nvim-treesitter/nvim-treesitter",
		build = ":TSUpdate",

		config = function()
			local configs = require("nvim-treesitter.configs")

			configs.setup({
				ensure_installed = { "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html" },
				sync_install = false,
				highlight = { enable = true },
				indent = { enable = true },
			})
		end,
	},

Issuing the command :TSInstallInfo / :TSModuleInfo also should show heex being enabled.

Gah! Worked out my issues (there were several!)

  1. The main one: I was using a colorscheme which wasn’t configured properly for treesitter… Once I had the correct colorscheme I needed to get my terminal to display it properly.
  2. For reasons which are currently beyond me :wink: when I open vim in iterm (in tmux) it doesn’t display properly at all, when I do exactly the same thing in alacritty it works fine. Frankly I’ve spent too much time fiddling and now that it’s working I don’t want to spend the time to work out why!
  3. I had an old augroup for elixir which was manually setting .heex files to elixir, I think this was from years ago when I was first playing with it, and things like vim-elixir maybe didn’t exist? (or were more out of date). Anyway, removing that group meant that the .html.eex displays properly.

Anyway - all working just fine now → Imgur: The magic of the Internet … Hopefully this helps some others!