Detect nix-shell shebangs
ashkitten opened this issue · 10 comments
What exactly do you mean with detect nix-shell shebangs
?
I assume having something like this higlight as python.
#!/usr/bin/env nix-shell
#!nix-shell -i python3.6 -p "python36.withPackages (p: with p; [ pyyaml ])"
import yaml
print(42)
@LnL7: That doesn't make sense because this should already be highlighted as Python.
How? Unless I add a modeline it doesn't for me, standard shebang filetype detection only works for #!/usr/bin/env foo
or #!/bin/foo
.
@LnL7: Well, in my case it's because of the .py
suffix, but yeah... now I understand what they meant.
@ncfavier I am not really the person to ask about this since I'm not a user of or even a contributor to the plugin.
Does this sort of thing end up in the vim tree often?
I have no idea! I'm asking because you initiated #47.
I guess it doesn't hurt to implement the nix-shell detection logic here and then see if it can be upstreamed...
I know for certain that vim has syntax in the tree but I don't know about other features. I would probably be hesitant to add more if I were a maintainer.
So I would agree. Probably do the work in the plugin and see if it could be upstreamed afterwards.