Files
nvim/lua/plugins/colorscheme.lua
T
2026-11-12 23:55:14 +01:00

76 lines
2.1 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" },
-- Only the integrations for plugins this config uses, so nothing else is set up at startup.
default_integrations = false,
auto_integrations = false,
integrations = {
treesitter = true,
native_lsp = { enabled = true },
semantic_tokens = true,
blink_cmp = { style = "bordered" },
flash = true,
gitsigns = true,
snacks = { enabled = true },
render_markdown = true,
markview = true,
mini = { enabled = true, indentscope_color = "mauve" },
neotest = true,
noice = true,
dap = true,
dap_ui = false,
treesitter_context = true,
which_key = true,
},
},
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,
},
},
}