Colorscheme not found if used from a VeryLazy autocmd #1984
Unanswered
Shaobin-Jiang
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A minimum config that works correctly:
Basically it sets up tokyonight as the colorscheme. Despite my having lazy loaded the plugin, lazy.nvim has created a
ColorSchemePre
autocmd that ensures any colorscheme plugin not loaded when thecolorscheme
command is executed be loaded first. So I assume that, since this would work during startup, it surely would work as well if I postpone thecolorscheme
command tillVeryLazy
, and this is how I modified the code:And now, neovim complains about not being able to find the colorscheme.
This baffles me since
VeryLazy
occurs well after startup. In this second piece of code, when I usecolorscheme
, theColorSchemePre
autocmd ought to have been set up correctly, and yet it does not.I know how to solve this. Just using
require("lazy.core.loader").colorscheme("tokyonight")
does the trick. However, I am at a loss as to why the matter should exist in the first place.Beta Was this translation helpful? Give feedback.
All reactions