roxma / nvim-yarp

Yet Another Remote Plugin Framework for Neovim
MIT License
229 stars 14 forks source link

make python exe detection more reliable for vim8 #30

Closed skeept closed 5 years ago

skeept commented 5 years ago

I don't use neovim but I tested the pull request with windows and in cygwin and it works well in vim8 in both environments.

roxma commented 5 years ago

I think the python3 requirement is specified clearly in the README and you should follow that. I don't think it's worth adding the complexity. In case I need to explain how it works when it does not work.

Especially, python is not a good candidate, it points to python2 on many linux distros.

skeept commented 5 years ago

The requirement is listed but the problem is that I need would like to sync my vim configuration over different machines I have have to add logic for each of the machines which is not so nice. Even in the same machine I am using it with windows and with cygwin so that creates issues. The patch I propose can fix these issues.

You already have some logic there for neovim:

python import sys let g:_yarp_py = pyeval('sys.executable')

This would also work for vim, but this is incorrect because sys.executable can point to vim instead of python in windows.

The code I propose is an enhancement over that.

Python3 is a better candidate than python, because as you say sometimes python can be pointing to python2. In the windows python I use there is no python3.exe the executable name is simply python.exe.

So the logic I add there is to consider python3 as a candidate before python.

hokorobi commented 5 years ago

How about using py3eval('sys.exec_prefix') for Vim?

hokorobi commented 5 years ago

How about using py3eval('sys.exec_prefix') for Vim?

Like this.

roxma commented 5 years ago

@hokorobi

Thanks. I prefer using sys.exec_prefix. I'll test it when I have some free time.

roxma commented 5 years ago

Closing...

sys.exec_prefix could be the same for python2 and python3.

I don't want to implicitly take python instead when python3 is not available. It's hard to cover all use cases. It's not worth the complexity.

Just set g:python3_host_prog manually when you need customization.

skeept commented 5 years ago

I think it would be worth to try to take this burden off the user. It may add a little complexity but it would not be that hard.

But it's your call, as for me I have decided to go the other way and actually stop using all plugins that use python. I don't add additional configuration for each plugin. I will miss denite.

Thanks for considering,

Regards,

On Mon, May 20, 2019 at 10:23 PM rox notifications@github.com wrote:

Closing...

sys.exec_prefix could be the same for python2 and python3.

I don't want to implicitly take python instead when python3 is not available. It's hard to cover all use cases. It's not worth the complexity.

Just set g:python3_host_prog manually when you need customization.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/roxma/nvim-yarp/pull/30?email_source=notifications&email_token=AABX3OIAKDAKYAHQ3JO4N4LPWNTLRA5CNFSM4HBKP5HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2UNKA#issuecomment-494225064, or mute the thread https://github.com/notifications/unsubscribe-auth/AABX3OLGP7HPAQIGOI7I4K3PWNTLRANCNFSM4HBKP5HA .