return { { "RRethy/base16-nvim", priority = 1000, config = function() -- Настройка базовой палитры base16 require("base16-colorscheme").setup({ base00 = "{{colors.background.default.hex}}", base01 = "{{colors.surface_container_lowest.default.hex}}", base02 = "{{colors.surface_container_low.default.hex}}", base03 = "{{colors.outline_variant.default.hex}}", base04 = "{{colors.on_surface_variant.default.hex}}", base05 = "{{colors.on_surface.default.hex}}", base06 = "{{colors.inverse_on_surface.default.hex}}", base07 = "{{colors.surface_bright.default.hex}}", base08 = "{{colors.tertiary.default.hex | lighten: -5}}", base09 = "{{colors.tertiary.default.hex}}", base0A = "{{colors.secondary.default.hex}}", base0B = "{{colors.primary.default.hex}}", base0C = "{{colors.tertiary_container.default.hex}}", base0D = "{{colors.primary_container.default.hex}}", base0E = "{{colors.secondary_container.default.hex}}", base0F = "{{colors.secondary.default.hex | lighten: -10}}", }) -- Вспомогательная функция для массовой установки групп подсветки local function set_hl_multiple(groups, value) for _, group in ipairs(groups) do vim.api.nvim_set_hl(0, group, value) end end -- Кастомные группы подсветки vim.api.nvim_set_hl(0, "Visual", { bg = "{{colors.primary_container.default.hex}}", fg = "{{colors.on_primary_container.default.hex}}", }) set_hl_multiple({ "String", "TSString" }, { fg = "{{colors.tertiary.default.hex | lighten: -15.0 }}", }) set_hl_multiple({ "TSComment", "Comment" }, { fg = "{{colors.outline.default.hex}}", italic = true, }) set_hl_multiple({ "TSMethod", "Method" }, { fg = "{{colors.tertiary.default.hex}}", }) set_hl_multiple({ "TSFunction", "Function" }, { fg = "{{colors.secondary.default.hex}}", }) set_hl_multiple({ "Keyword", "TSKeyword", "TSKeywordFunction", "TSRepeat" }, { fg = "{{colors.inverse_primary.default.hex}}", }) -- Автоматическая перезагрузка темы при изменении файла конфигурации local theme_file_path = vim.fn.stdpath("config") .. "/lua/plugins/dankcolors.lua" if not _G._matugen_theme_watcher then local uv = vim.uv or vim.loop _G._matugen_theme_watcher = uv.new_fs_event() _G._matugen_theme_watcher:start( theme_file_path, {}, vim.schedule_wrap(function() -- Перезагружаем файл и повторно вызываем конфиг плагина local ok, new_spec = pcall(dofile, theme_file_path) if ok and new_spec and new_spec[1] and new_spec[1].config then new_spec[1].config() vim.notify("Matugen theme reloaded", vim.log.levels.INFO) end end) ) end end, }, }