patrickdavey

patrickdavey

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!

First Post!

nTraum

nTraum

[…] 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.

Last Post!

patrickdavey

patrickdavey

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 → https://imgur.com/a/y02yJOq .. Hopefully this helps some others!

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement