Upstreaming nix syntax into {neo-,}vim tree

It would be very cool if one could use a stock {neo-,}vim on any old platform to open up a nix file and get syntax highlighting without any plugins. Currently the most “official”, best, vim plugin I know of is is GitHub - LnL7/vim-nix: Vim configuration files for Nix http://nixos.org/nix. I know @LnL7 is quite busy and might be unavailable to comment, but I was hoping maybe some other community members might provide some input on what to do about this issue I raised recently: Upstream syntax highlighting? · Issue #47 · LnL7/vim-nix · GitHub

If there is a better syntax option out there, I would be happy see that go upstream instead. I am not a {neo-,}vim user myself, so I don’t really feel like I’m the one to do the maintenance on this work. If the amount of change on the vim-nix syntax file is any indication, though, there shouldn’t be too much effort involved in being the one to answer the call when PRs come in.

Edit: Moved to #dev from #learn since I think it is more appropriate

2 Likes

What’s your motivation then ?

Neovim gets runtime patches from vim so upstreaming should go through vim first. Neovim also has some experimental support for treesitter and there is a nix grammar. Wont be upstreamed though.

1 Like

Neovim gets runtime patches from vim so upstreaming should go through vim first. Neovim also has some experimental support for treesitter and there is a nix grammar. Wont be upstreamed though.

Yes! That’s why I think upstreaming to vim is the best first thing to do.

What’s your motivation then ?

I have a few motivations:

  1. Marketing - for Nix to be mainstream, it needs to start being in the default options of various platforms. Simple editor support seems like a nice place to start
  2. I sometimes have to use vim on remote machines where I don’t have a config. Editing Nix files sans syntax highlighting usually means set ft=haskell and living with it.
  3. It would be nice for vim users wanting to try nix out without commiting to much
  4. It would save @LnL7 some maintenance.
  5. There are a few prominent Nix users that use vim without configurations who I think would be happy to have it.

Edit: Add some more motivations

I opened feat: Add support for the Nix programming language. by jsoo1 · Pull Request #11646 · vim/vim · GitHub