From b36ab7916276d16779eca4f5bf98d9cfdbcead41 Mon Sep 17 00:00:00 2001 From: brustybee Date: Sun, 15 Mar 2026 01:57:01 +0530 Subject: meow in excitement --- cats.nix | 10 +---- colors/bee_matugen.lua | 98 +++++++++++++++++++++++++++++++++++++++++++++ flake.lock | 17 ++++++++ flake.nix | 2 + lua/config/colorschemes.lua | 82 ------------------------------------- lua/config/init.lua | 2 +- lua/config/options.lua | 3 +- lua/plugins/misc.lua | 8 ++-- 8 files changed, 125 insertions(+), 97 deletions(-) create mode 100644 colors/bee_matugen.lua delete mode 100644 lua/config/colorschemes.lua diff --git a/cats.nix b/cats.nix index 953f6bf..cf24548 100644 --- a/cats.nix +++ b/cats.nix @@ -66,15 +66,7 @@ in startupPlugins = with pkgs.vimPlugins; { theme = [ - kanagawa-nvim - vague-nvim - kanso-nvim - rose-pine - catppuccin-nvim - tokyonight-nvim - gruvbox-material-nvim - onedark-nvim - onedarkpro-nvim + pkgs.neovimPlugins.base46-nvim ]; ui = [ diff --git a/colors/bee_matugen.lua b/colors/bee_matugen.lua new file mode 100644 index 0000000..cd2ea1e --- /dev/null +++ b/colors/bee_matugen.lua @@ -0,0 +1,98 @@ +local present, base46 = pcall(require, "base46") +if not present then + vim.notify("base46 plugin not found or incorrect.", vim.log.levels.ERROR, { title = "matugen integration" }) + return +end + +local config_home = vim.env.XDG_CONFIG_HOME +if config_home == nil or #config_home == 0 then + config_home = vim.fs.joinpath(vim.env.HOME, ".config") +end + +local settings_file_path = vim.fs.joinpath(config_home, "matugen", "neovim_matugen.json") + +local settings_file = io.open(settings_file_path, "r") +if settings_file == nil then + vim.notify( + "Cannot read matugen settings file at '" .. settings_file_path .. "'. Did you run beesettings wall?", + vim.log.levels.WARN, + { title = "matugen integration" } + ) + return +end + +local content = settings_file:read("*a") +settings_file:close() + +local ok, settings = pcall(vim.json.decode, content) +if not ok or not settings then + vim.notify("Failed to parse matugen JSON", vim.log.levels.ERROR, { title = "matugen integration" }) + return +end + +local harmony = settings.harmony or 0.5 +local source_color = settings.source_color +local bg_color = settings.background + +if not source_color or not bg_color then + vim.notify( + "Missing colors in matugen JSON. Check your template.", + vim.log.levels.ERROR, + { title = "matugen integration" } + ) + return +end + +-- local theme_base = "github_" .. vim.o.background +local theme_base = "kanagawa" +if vim.o.background == "light" then + theme_base = "one_light" +end +local theme_name = "bee_matugen" +vim.o.background = settings.mode + +if not _G._matugen_theme_watcher then + local uv = vim.uv or vim.loop + _G._matugen_theme_watcher = { uv.new_fs_event(), reload_timer = uv.new_timer() } + + local debounce_time = 100 -- ms + local function handler() + _G._matugen_theme_watcher.reload_timer:stop() + _G._matugen_theme_watcher.reload_timer:start( + debounce_time, + 0, + vim.schedule_wrap(function() + -- Clear the cached theme table to force a rebuild + local f = io.open(settings_file_path, "r") + if f then + local new_content = f:read("*a") + f:close() + local ok_new, new_settings = pcall(vim.json.decode, new_content) + if ok_new and new_settings.mode then + vim.o.background = new_settings.mode + end + end + base46.theme_tables[theme_name] = nil + if vim.g.colors_name == theme_name then + vim.cmd.colorscheme(theme_name) + end + + _G._matugen_theme_watcher[1]:stop() + _G._matugen_theme_watcher[1]:start(settings_file_path, {}, handler) + end) + ) + end + _G._matugen_theme_watcher[1]:start(settings_file_path, {}, handler) +end + +if not base46.theme_tables[theme_name] or base46.theme_tables[theme_name].type ~= vim.o.background then + local builtin = vim.deepcopy(assert(base46.get_builtin_theme(theme_base))) + + local harmonized = base46.theme_harmonize(builtin, source_color, harmony) + harmonized = base46.theme_set_bg(harmonized, bg_color) + + base46.theme_tables[theme_name] = harmonized +end + +base46.load(theme_name) +vim.g.colors_name = theme_name diff --git a/flake.lock b/flake.lock index 7fc9811..c0d6476 100644 --- a/flake.lock +++ b/flake.lock @@ -334,6 +334,22 @@ "type": "github" } }, + "plugins-base46-nvim": { + "flake": false, + "locked": { + "lastModified": 1773491679, + "narHash": "sha256-oJkbSuuTlQkh74MTBlgjwfzu5ybelWjHUpr6EfIAeA4=", + "owner": "AvengeMedia", + "repo": "base46", + "rev": "b242464654a42310a1b76efe522ddbfb74c4847f", + "type": "github" + }, + "original": { + "owner": "AvengeMedia", + "repo": "base46", + "type": "github" + } + }, "plugins-lze": { "flake": false, "locked": { @@ -426,6 +442,7 @@ "neovim-nightly-overlay": "neovim-nightly-overlay", "nixCats": "nixCats", "nixpkgs": "nixpkgs_2", + "plugins-base46-nvim": "plugins-base46-nvim", "plugins-lze": "plugins-lze", "plugins-lzextras": "plugins-lzextras", "plugins-neogit": "plugins-neogit", diff --git a/flake.nix b/flake.nix index 8be4059..b4732b2 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,8 @@ plugins-opencode-nvim.flake = false; plugins-neogit.url = "github:NeogitOrg/neogit"; plugins-neogit.flake = false; + plugins-base46-nvim.url = "github:AvengeMedia/base46"; + plugins-base46-nvim.flake = false; neovim-nightly-overlay = { url = "github:nix-community/neovim-nightly-overlay"; }; diff --git a/lua/config/colorschemes.lua b/lua/config/colorschemes.lua deleted file mode 100644 index f09ecd3..0000000 --- a/lua/config/colorschemes.lua +++ /dev/null @@ -1,82 +0,0 @@ -if nixCats("theme") then - require("vague").setup({ - transparent = true, - bold = false, - }) - - require("gruvbox-material").setup({ - italics = true, - contrast = "medium", - comments = { - italics = true, - }, - background = { - transparent = true, - }, - float = { - force_background = true, - background_color = nil, - }, - }) - - require("kanso").setup({ - compile = true, - transparent = true, - dimInactive = false, - terminalColors = true, - overrides = function(colors) - local theme = colors.theme - return { - Pmenu = { fg = theme.ui.fg, bg = theme.ui.bg_p1 }, - NormalFloat = { bg = theme.ui.bg_p1 }, - FloatTitle = { fg = theme.ui.special, bg = theme.ui.bg_p1 }, - FloatBorder = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, - } - end, - background = { - dark = "ink", - light = "pearl", - }, - foreground = "default", - }) - - require("rose-pine").setup({ - styles = { - bold = true, - italic = true, - transparency = true, - }, - }) - - require("kanagawa").setup({ - compile = true, - undercurl = true, - commentStyle = { italic = true }, - functionStyle = {}, - keywordStyle = { italic = true }, - statementStyle = { bold = true }, - typeStyle = {}, - transparent = true, - dimInactive = false, - terminalColors = true, - colors = { - palette = {}, - theme = { - wave = {}, - lotus = {}, - dragon = {}, - all = { ui = { bg_gutter = "none" } }, - }, - }, - overrides = function(colors) - return {} - end, - theme = "dragon", - background = { - dark = "dragon", - light = "lotus", - }, - }) -end - -return {} diff --git a/lua/config/init.lua b/lua/config/init.lua index 2be1996..afc9d18 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -1,4 +1,4 @@ require("config.options") -require("config.colorschemes") +-- require("colors.colorschemes") require("config.keys") require("config.lsp") diff --git a/lua/config/options.lua b/lua/config/options.lua index c50b859..980f1c8 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -15,7 +15,8 @@ vim.o.showcmd = false vim.o.signcolumn = "yes" vim.o.cursorline = true vim.o.cursorlineopt = "number" -- Restricts the highlight ONLY to the number column -vim.o.background = "dark" +-- vim.o.background = "dark" +vim.o.winborder = "single" vim.o.conceallevel = 2 vim.o.autoread = true diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua index f1aa60b..4dc1a7b 100644 --- a/lua/plugins/misc.lua +++ b/lua/plugins/misc.lua @@ -74,10 +74,10 @@ return { chunk = { enable = true, priority = 15, - style = { - vim.api.nvim_get_hl(0, { name = "IndentBlanklineIndent1" }), - vim.api.nvim_get_hl(0, { name = "DiagnosticError" }), - }, + -- style = { + -- vim.api.nvim_get_hl(0, { name = "IndentBlanklineIndent1" }), + -- vim.api.nvim_get_hl(0, { name = "DiagnosticError" }), + -- }, use_treesitter = true, chars = { horizontal_line = "─", -- cgit v1.3.1