Replies: 1 comment 3 replies
-
require("lazy").setup({
{
"xxx/onedark.nvim",
event = { "BufReadPre", "BufWinEnter" },
cond = vim.fn.hostname() == "abc",
config = function()
require('onedark').load()
end,
},
{
"xxx/gruvbox.nvim",
event = { "BufReadPre", "BufWinEnter" },
cond = vim.fn.hostname() ~= "abc",
config = function()
vim.o.background = "light"
vim.cmd("colorscheme gruvbox")
end,
},
}) |
Beta Was this translation helpful? Give feedback.
3 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
EDIT: I should have been more clear--I want both colorschemes to load, but set a default one.
I have a colorscheme.lua in plugins folder containing multiple themes. I have code to load theme depending on hostname. I need this to be set early because I have plugins that set overrides some highlight groups after.
What is a recommended approach?
I can add the conditional test after the setup function of each theme but it will run for each theme, setting it multiple times (I don't know enough lua, maybe this is an easy fix).
Do I make the simple conditional check to load a particular theme as its own plugin spec (is this possible? What would it look like?) and then add color.scheme.lua as a dependency (or alternatively set priorities).
The conditional statement is this, which should run as soon as plugins/colorchemes.lua is loaded and and before the rest of the plugins in plugins/:
Beta Was this translation helpful? Give feedback.
All reactions