nixos-config icon indicating copy to clipboard operation
nixos-config copied to clipboard

neovim: Fenced syntax highlighting isn't working

Open rummik opened this issue 2 years ago • 5 comments

Partly due to using tree-sitter instead of patched vim-nix.

It looks like it might just be a matter of updating nvim-treesitter since https://github.com/nvim-treesitter/nvim-treesitter/pull/3842 was merged

rummik avatar Nov 27 '22 00:11 rummik

I couldn't figure out how to do dynamic injections based on comments, this is what I have so far, but it doesn't work

((comment) @language
  (indented_string_expression (string_fragment) @content) ; this is just a string
  (#offset! @language 0 2 0 -2)
  (#trim! @language))

figsoda avatar Nov 29 '22 03:11 figsoda

My config doesn't seem to function with the existing injections either, so I'm not really sure what's up with it. I assume it's something on my end though

Thanks for your WIP dynamic injections though! Once I get the other injections working on my config I'll have to experiment

rummik avatar Nov 29 '22 04:11 rummik

if runCommand injections are not working for you, https://github.com/nvim-treesitter/nvim-treesitter/pull/3890 should be able to fix this, others have been working for me so I'm not sure

figsoda avatar Nov 29 '22 04:11 figsoda

Ah, turns out that I was overriding the wrong package, and nixvim was causing some slight interactions. A current checkout of nvim-treesitter does work, sans language hint comments of course

rummik avatar Nov 29 '22 05:11 rummik

I opened https://github.com/nvim-treesitter/nvim-treesitter/pull/3902 to implement this, adding a directive is the only way I was able to get it working

figsoda avatar Dec 01 '22 05:12 figsoda