Multiple colorschemes in one file #547
Unanswered
kevinvelasquez9
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Update: I changed my -- Use your favorite color scheme
local colorscheme = "tokyonight"
local M = {
{ "catppuccin/nvim", name = "catppucin" },
{ "bluz71/vim-moonfly-colors", name = "moonfly" },
{ "bluz71/vim-nightfly-colors", name = "nightfly" },
{ "wuelnerdotexe/vim-enfocado", name = "enfocado" },
{ "ellisonleao/gruvbox.nvim", name = "gruvbox" },
{ "rebelot/kanagawa.nvim", name = "kanagawa" },
{ "arturgoms/moonbow.nvim", name = "moonbow" },
{ "folke/tokyonight.nvim", name = "tokyonight" },
{ "askfiy/visual_studio_code", name = "visual_studio_code_dark" },
{ "NTBBloodbath/sweetie.nvim", name = "sweetie" },
}
for _, v in pairs(M) do
if v.name == colorscheme then
v.config = function()
vim.cmd.colorscheme(colorscheme)
end
end
end
return M |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you can replace this local ok, _ = pcall(vim.cmd.colorscheme, colorscheme)
if not ok then
print("Failed to load a colorscheme!")
end I don't fully understand what are you trying to do here. You can't "load" multiple colorschemes at once. |
Beta Was this translation helpful? Give feedback.
2 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.
-
I would like to load multiple colorschemes in one file (
lua/plugins/colorschemes.lua
) like so:Is there a way to also set a colorscheme in this file? The only way I can think of is this way but it seems redundant because of the repeated enabled and config:
Beta Was this translation helpful? Give feedback.
All reactions