Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect nix-shell shebangs #10

Open
ashkitten opened this issue Mar 29, 2017 · 10 comments · May be fixed by #51
Open

Detect nix-shell shebangs #10

ashkitten opened this issue Mar 29, 2017 · 10 comments · May be fixed by #51

Comments

@ashkitten
Copy link

No description provided.

@aszlig
Copy link
Contributor

aszlig commented Aug 17, 2018

What exactly do you mean with detect nix-shell shebangs?

@LnL7
Copy link
Owner

LnL7 commented Aug 17, 2018

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)

@aszlig
Copy link
Contributor

aszlig commented Aug 17, 2018

@LnL7: That doesn't make sense because this should already be highlighted as Python.

@LnL7
Copy link
Owner

LnL7 commented Aug 17, 2018

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.

@aszlig
Copy link
Contributor

aszlig commented Aug 17, 2018

@LnL7: Well, in my case it's because of the .py suffix, but yeah... now I understand what they meant.

@ncfavier
Copy link

ncfavier commented Jun 6, 2023

I'd like to tackle this issue, but given that vim-nix is currently straddling between this repository and vim upstream, I'm not sure where this should be implemented.

@jsoo1 @equill any opinions?

@jsoo1
Copy link

jsoo1 commented Jun 6, 2023

@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?

@ncfavier
Copy link

ncfavier commented Jun 6, 2023

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...

@jsoo1
Copy link

jsoo1 commented Jun 6, 2023

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.

@ncfavier ncfavier linked a pull request Jun 8, 2023 that will close this issue
3 tasks
@ncfavier
Copy link

ncfavier commented Jun 8, 2023

Opened #51 as a half-working proof of concept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants