linux-cultist / venv-selector.nvim

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

Doesn't seems to be loaded at all #124

Closed AM-I-Human closed 1 month ago

AM-I-Human commented 1 month ago

Given the following config, the command VenvSelect still isn't available.

require 'options.global'
require 'options.opt'
require 'options.mouse'
require 'keymaps.load_keymaps'
require 'functions.autocommands'
require 'functions.reload'

-- [[ Install `lazy.nvim` plugin manager ]]
--    See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
    local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
    vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)

-- [[ Configure and install plugins ]]
require('lazy').setup({
    'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
    {
        'linux-cultist/venv-selector.nvim',
        dependencies = {
            'neovim/nvim-lspconfig',
            'mfussenegger/nvim-dap',
            'mfussenegger/nvim-dap-python',
            { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
        },
        lazy = false,
        branch = 'regexp',
    },
    { import = 'plugins' }, --    For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
}, {
    ui = {
        -- If you are using a Nerd Font: set icons to an empty table which will use the
        -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
        icons = vim.g.have_nerd_font and {} or {
            cmd = '⌘',
            config = '🛠',
            event = '📅',
            ft = '📂',
            init = '⚙',
            keys = '🗝',
            plugin = '🔌',
            runtime = '💻',
            require = '🌙',
            source = '📄',
            start = '🚀',
            task = '📌',
            lazy = '💤 ',
        },
    },
})

Tried with: -separated file in the plugin folder -before the import plugins part and after -with the exact table given (don't seems to work, it says that a second argument is aspected)

Nvim 0.10.0 MacOs

I recently made a new config that can be found here:https://github.com/AM-I-Human/nvim-config

linux-cultist commented 1 month ago

Thanks for reporting this, I will look into it right away. :)

linux-cultist commented 1 month ago

OK, found the issue. I refactored some code yesterday and failed to test the plugin with an empty config. Now it will work!

Update it to the latest commit and you should be able to start using it. :)

If you want to configure the plugin, you need to call the setup function with your settings, but thats not a requirement either.

{
        "linux-cultist/venv-selector.nvim",
        dependencies = {
            "neovim/nvim-lspconfig",
            "mfussenegger/nvim-dap", --optional
            "mfussenegger/nvim-dap-python", --optional
            { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
        },
        lazy = false,
        branch = "regexp",
        config = function()
            require("venv-selector").setup({
            -- your config here
            })
        end,
        keys = {
            { ",v", "<cmd>VenvSelect<cr>" },
        },
    },
linux-cultist commented 1 month ago

Closing the issue, hopefully it works for you now. :)

AM-I-Human commented 1 month ago

It works 😄 Great job ❤️