michaelb / sniprun

A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages
MIT License
1.43k stars 46 forks source link

[FEATURE] Explicit configuration for binaries #263

Closed ghostbuster91 closed 8 months ago

ghostbuster91 commented 9 months ago

Is your feature request related to a problem? Please describe. Hi, first of all, thank you for this great plugin :)

While configuring it I noticed that for go interpreter there is an option to provide path to go binary explicitly. However this option is missing in many other interpreters. I use nixos and there are no global installations in my system.

For example:

Describe the solution you'd like

Every interpreter should allow for passing compiler/interpreter binary explicitly. This should be optional option, which when not provided falls back to default globally accesible binary.

Describe alternatives you've considered

Installing nodejs and other interpreters globally which I would like to avoid.

michaelb commented 9 months ago

That does sound reasonable :-), and not too hard

What about a global 'path' option that updates $PATH only for sniprun ?

I'll work on it anyway by the end of the week

ghostbuster91 commented 9 months ago

I am not sure if I follow. Would this be a shared path(shared between all sniprun interpreters) that contains all binaries that are needed for sniprun?

I guess it could work but I would still prefer to have it as an option on the interpreter level. This will still allow creation of interpreters that depend on conflicting binaries e.g. go version 1.1 and go version 1.2

michaelb commented 9 months ago

Would this be a shared path(shared between all sniprun interpreters) that contains all binaries that are needed for sniprun?

Yes

I guess it could work but I would still prefer to have it as an option on the interpreter level. This will still allow creation of interpreters that depend on conflicting binaries e.g. go version 1.1 and go version 1.2

Indeed, this is a better solution with this issue in perspective (a bit more tedious to implement though, which is why i asked)