AckslD / swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.
212 stars 29 forks source link

Swenv doesn't find Conda enviroments on Arch #44

Closed AmirGhiassian closed 4 months ago

AmirGhiassian commented 4 months ago

These are my Conda environments:

image

And here is Swenv:

image

I'm not sure if I am using the plugin wrong, or if I configured something wrong. But I decided to submit my first issue on GitHub to try and figure this out :)

AmirGhiassian commented 4 months ago

I have seem to found the fix, and I apologize for putting out this issue. You can specify specific directories in the setup,

Here is my config if anyone else was in the same boat as me: `require('swenv').setup({ get_venvs = function(venvs_path) local venvs = require('swenv.api').get_venvs()

local more_venvs = {}
local scan_dir = require('plenary.scandir').scan_dir
local paths = scan_dir("<PathToScan>", { depth = 1, only_dirs = true, silent = true })
for _, path in ipairs(paths) do
  local env_name = vim.fn.fnamemodify(path, ":t")
  table.insert(more_venvs, {
    name = env_name,
    path = path,
    source = 'conda',
  })
end
return vim.tbl_deep_extend("keep", venvs, more_venvs)

end, post_set_venv = function() lvim.autocommands = { "LspRestart" } // I am using Lvim in this case, change syntax based on what you are using end }) `