linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
378 stars 40 forks source link

Add miniconda venv support (linux only) #152

Open barikata1984 opened 6 days ago

barikata1984 commented 6 days ago

What

Find Miniconda envs directories set up with the standard installation and make them selectable.

Why

Some users, including me, prefer Miniconda to Anaconda. Making the venvs created by miniconda selectable as the default behaviour of this plug-in sounds cool.

How

Just follow how Anaconda envs are detected.

Note

The same approach should work on MacOS and Windows. But, I have not implemented and tested it because I do not have those machines right now.

RobertoRRW commented 4 days ago

Hardcoding the paths runs into the same mistakes that are in the current code. This won't work if using either miniforge or mambaforge; or if the user decides to install somewhere other than the default location. All these variations of conda use common environment variables that should be used instead of all these variations of Anaconda, conda, miniconda, etc.

Base is at $(dirname $CONDA_EXE) and the envs are at $(dirname $CONDA_EXE)/../envs.

barikata1984 commented 3 days ago

@RobertoRRW

Why don't you post an improvement request or make a PR? Hardcoding is the approach this plugin has employed to locate venvs. The objective of this PR is just to add the ability to find miniconda envs without custom configurations

linux-cultist commented 1 day ago

@RobertoRRW I think the best we can do is let the user define their own searches if the venvs are not in their default location. And that's what the regexp version of the plugin adds, besides a general cleanup of code. :)

linux-cultist commented 1 day ago

@barikata1984 Thanks a lot for the PR, I will review it in a week since I'm on vacation currently. :)