vim-nix icon indicating copy to clipboard operation
vim-nix copied to clipboard

Detect nix-shell shebangs

Open ncfavier opened this issue 2 years ago • 2 comments

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

To do:

  • [ ] expose and use vim's interpreter → filetype conversion logic. Currently the filetype is set to the interpreter, which breaks for things like python3 or runhaskell.
  • [ ] make this work with Neovim; currently the filetype is detected as nix because of https://github.com/neovim/neovim/issues/23880#issuecomment-1573549418
  • [ ] upstream this in Vim? (https://github.com/vim/vim/issues/12507)

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.

ncfavier avatar Jun 08 '23 15:06 ncfavier

@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 :)

Ma27 avatar Jul 29 '23 11:07 Ma27

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.

ncfavier avatar Jul 29 '23 11:07 ncfavier