nvim-neorocks / rocks-config.nvim

Allow rocks.nvim to help configure your plugins.
GNU General Public License v3.0
55 stars 2 forks source link

Cannot find colorscheme error when setting colorscheme in plugin config #22

Closed AzurIce closed 4 months ago

AzurIce commented 4 months ago

I'm trying to install and configure material.nvim

my lua/plugin/material.lua is as follows:

require('material').setup({
  -- ...
})

vim.cmd.colorscheme 'material'

error:

5113: Error while calling lua chunk: ...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: /Users/azurice/.config
/nvim/lua/plugins/material.lua:69: Vim:E185: cannot find colorscheme 'material'
stack traceback:
        [C]: in function 'error'
        ...cal/share/nvim/rocks/rocks_rtp/lua/rocks-config/init.lua:41: in function 'setup'
        ...rocks/rocks_rtp/lua/rocks-config/rocks/hooks/preload.lua:20: in function 'hook'
        ...local/share/nvim/rocks/rocks_rtp/lua/rocks/api/hooks.lua:63: in function 'run_preload_hooks'
        .../luarocks/rocks-5.1/rocks.nvim/2.19.1-1/plugin/rocks.lua:31: in main chunk

And it doesn't appear in the auto completion of :colorscheme, But if I remove the line vim.cmd.colorscheme 'material', It shows in the colorscheme list, and I can use :colorscheme to set it correctly.

What's the proper way to set colorscheme?

mrcjkb commented 4 months ago

Hey 👋

See this response regarding colorschemes 😃

I think we probably need to add some clearer documentation for colorschemes to the readmes. This is the third time this issue has come up :sweat_smile:

AzurIce commented 4 months ago

Oh, I see! Thanks very much for your reply, and sorry for bothering again. 🤣

mrcjkb commented 4 months ago

This is a rocks.nvim issue, so I've created https://github.com/nvim-neorocks/rocks.nvim/issues/237. Closing this as duplicate.