LnL7 / vim-nix

Vim configuration files for Nix http://nixos.org/nix
MIT License
287 stars 26 forks source link

Detect nix-shell shebangs #51

Open ncfavier opened 1 year ago

ncfavier commented 1 year ago

Fixes https://github.com/LnL7/vim-nix/issues/10

To do:

The implementation of shellwords here should be correct, but doesn't match the one Nix currently uses. That will be fixed by https://github.com/NixOS/nix/pull/8470.

Ma27 commented 11 months ago

@ncfavier do you need assistance with this? Or, where exactly is this stuck? The neovim issue is closed for instance. Re upstreaming this into mainline vim: I'm fine with integrating this here first considering that this is the de-facto package for Nix users using vim[1]. Re exposing the filetype detection logic: is there anything to be done in upstream vim?

[1] That said, considering the complexity of the code, tests are a hard requirement for me :)

ncfavier commented 11 months ago

Thanks for taking an interest in this, I kind of lost interest myself.

The main thing is "expose and use vim's interpreter → filetype conversion logic". I brought this up in the vim issue linked above but nothing has happened yet. It should be straightforward to submit a patch. This code should be moved into a separate function and exported.