nvim-cmp-fonts icon indicating copy to clipboard operation
nvim-cmp-fonts copied to clipboard

How to install using lazy.nvim?

Open adityamwagh opened this issue 1 year ago • 1 comments

using { "amarakon/nvim-cmp-fonts", opts = {} } leads to the following error message:

Failed to run `config` for nvim-cmp-fonts
.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:355: attempt to call field 'setup' (a nil value)
# stacktrace:
  - AppData\Local\nvim\init.lua:106

adityamwagh avatar Aug 16 '23 23:08 adityamwagh

Sorry for the late response. I actually switched to lazy.nvim from packer and I can provide an explanation.

I think the reason it is giving that error is because of the opts = {}. What that does is it attempts to call require("nvim-cmp-fonts").setup(), thus the error attempt to call field 'setup' (a nil value). You are not supposed to do that for nvim-cmp source plugins. What you should instead do is something like this:

{
    "hrsh7th/nvim-cmp",
    dependencies = "amarakon/nvim-cmp-fonts",
    opts = {
        sources = { name = "fonts" }
    }
}

Let me know if this works.

amarakon avatar Sep 23 '23 22:09 amarakon