Files
nvim/lua/plugins/colorscheme.lua
T
2026-11-05 15:12:49 +01:00

55 lines
1.5 KiB
Lua

-- All installed; only the active one loads, lazy.nvim loads the others on :colorscheme.
-- On the Linux desktop theme-apply.nu drives the colorscheme (see core/theme.lua);
-- without that file auto-dark-mode follows the system appearance.
local theme = require("core.theme")
local schemes = { "catppuccin", "tokyonight", "rose-pine", "kanagawa" }
local function cycle()
local current = vim.g.colors_name or ""
local idx = 1
for i, name in ipairs(schemes) do
if vim.startswith(current, name) then
idx = i
end
end
local next = schemes[idx % #schemes + 1]
vim.cmd.colorscheme(next)
vim.notify("colorscheme: " .. next)
end
return {
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
init = function()
vim.keymap.set("n", "<leader>tc", cycle, { desc = "Cycle colorscheme" })
end,
opts = {
flavour = "auto",
background = { light = "latte", dark = "mocha" },
},
config = function(_, opts)
require("catppuccin").setup(opts)
theme.setup()
end,
},
{ "folke/tokyonight.nvim", lazy = true },
{ "rose-pine/neovim", name = "rose-pine", lazy = true },
{ "rebelot/kanagawa.nvim", lazy = true },
{
"f-person/auto-dark-mode.nvim",
lazy = false,
cond = not theme.has_external(),
opts = {
set_dark_mode = function()
theme.set_background("dark")
end,
set_light_mode = function()
theme.set_background("light")
end,
},
},
}