Loading colorscheme (tokyonight.nvim) #212
-
I'm trying to switch to rocks.nvim from lazy.nvim but I'm having trouble loading colorscheme. My rocks.toml file is [rocks]
[plugins]
"rocks.nvim" = "2.17.0"
"oil.nvim" = "2.7.0"
"tokyonight.nvim" = "3.0.1" and in the end of my init.lua I have require('tokyonight').setup({ style='night' })
vim.cmd.colorscheme('tokyonight') but I get an error that the colorscheme is not found, however running Is there something I'm missing? Edit: I also tried with rocks-config.nvim, but it had the same problem. I could run |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I did some more trial and error and got it working by placing the config for the colorscheme in |
Beta Was this translation helpful? Give feedback.
-
Hey 👋 Neovim sources your init.lua before plugins are sourced. With rocks.nvim, the initialisation sequence is the closer to Neovim's built-in one (unlike lazy, we don't disable the built-in one), with two differences:
Update: This has now been merged, so you can use You should be able to use |
Beta Was this translation helpful? Give feedback.
Hey 👋
Neovim sources your init.lua before plugins are sourced.
lazy.nvim overrides the built-in loading mechanisms, and the
LazyPluginSpec.config
function is called after it loads plugins.With rocks.nvim, the initialisation sequence is the closer to Neovim's built-in one (unlike lazy, we don't disable the built-in one), with two differences:
lua
directory) is immediately available on the luapackage.path
(which is why you can callrequire('tokyonight').setup()
in you init.lua, which wouldn't be possible with plain Neovim).colors
,plugin
,autoload
, ...) are added to the runtimepath and sourced when Neovim loads rocks.nvim, which is a…