nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
18.82k stars 21.48k forks source link

Help with custom plugins / not loading #962

Closed rogerneel closed 4 months ago

rogerneel commented 4 months ago

I'm guessing the problem is on my end, but I can't seem to get a custom plugin loading. What I've done:

Uncommented import = 'custom.plugins', in lazy-plugins.lua

Edited custom/plugins/init.lua to be

return {
  require 'custom/plugins/supermaven'
}

(I also tried require 'supermaven' since the lua file is at the same level

Added file custom/plugins/supermaven.lua

return {
  {
    'supermaven-inc/supermaven-nvim',

    config = function()
      require('supermaven-nvim').setup({
        color = {
          suggestion_color = '#ffffff',
        }
      })
    end
  }
}

This config should be correct per the Supermaven docs here https://github.com/supermaven-inc/supermaven-nvim

I'm not able to see the plugin load in :Lazy

Thoughts or suggestions? Is there something I need to do to load custom plugins?

dam9000 commented 4 months ago

If you uncommented this:

import = 'custom.plugins',

Then you don't need this:

return {
  require 'custom/plugins/supermaven'
}

It should load the custom/plugins/supermaven.lua automatically.

rogerneel commented 4 months ago

@dam9000 thanks for the response! I tried simply having the supermaven.lua file in the custom/plugins directory with nothing in init.lua other than return {} and unfortunately that still didn't load it.

As a sanity check, I moved supermaven.lua to the kickstart/plugins directory and added require 'kickstart/plugins/supermaven', to the lazy-plugins.lua file and neovim immediately loaded the plugin and things seem to be working.

Is there some way I can help debug why custom plugins are not loading?

rogerneel commented 4 months ago

Well, good news! I got it working and it was a difference in my kickstart config.

I changed: import = 'custom.plugins', to: { import = 'custom.plugins' },

and it loaded!

I'm not sure why those curly braces are necessary, but it now seems to load plugins in the custom/plugins folder.