linux-cultist / venv-selector.nvim

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

Telescope options #104

Closed sho-87 closed 1 month ago

sho-87 commented 3 months ago

wondering if theres currently a way to pass opts to the telescope picker? the default paths to poetry venvs are really long on windows and makes it very hard to find the name of a venv, especially given poetry adds random numbers/letters to the end:

image

telescope has a path display option to shorten paths however you want. in my case I'd probably just display the name of the venv only for easier reading

is there a way to do this?

I think I can set this option globally, but I dont want all of my pickers to be shortened in the same way

linux-cultist commented 2 months ago

In the new version I'm working on in the regexp branch, this is supported using a callback function. So for every venv that is listed in the telescope viewer, you can specify a function that gets called for each venv. And then in that function you can choose to return a shortened name or a changed name.

If you feel like checking it out, there is an example in the Readme for the regexp branch. But it's still under heavy development. :)

linux-cultist commented 1 month ago

Closing this since it should work fine in the regexp version of the plugin. Check the Readme for examples how to add your callback function to modify the filename how you want. You can do it either for all venvs found or for your own specific search only. It's described in the readme. Hope you get it to work, otherwise just ask and I can help.