From f4d20a2ce2f826b3804e93a1e1ea328d210d753e Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Mon, 23 Mar 2026 20:31:21 -0400 Subject: [PATCH] feat: add new configuration modules - Add preconfig.lua for early initialization - Add themes.lua for theme management --- lua/config/preconfig.lua | 27 +++++++++++++++++++++++++++ lua/custom/themes.lua | 4 ++++ 2 files changed, 31 insertions(+) create mode 100755 lua/config/preconfig.lua create mode 100644 lua/custom/themes.lua diff --git a/lua/config/preconfig.lua b/lua/config/preconfig.lua new file mode 100755 index 0000000..c99687d --- /dev/null +++ b/lua/config/preconfig.lua @@ -0,0 +1,27 @@ +-- Disable netrw before anything else loads +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 +vim.g.loaded_netrwSettings = 1 +vim.g.loaded_netrwFileHandlers = 1 + +-- Apply transparent background after any colorscheme change +vim.api.nvim_create_autocmd('ColorScheme', { + pattern = '*', + callback = function() + vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NormalNC', { bg = 'none' }) + end, +}) + +local themes = require('custom.themes') +-- Set correct colorscheme before plugins load (prevents flash) +local is_dark = vim.trim(vim.fn.system('defaults read -g AppleInterfaceStyle 2>/dev/null')) == 'Dark' +vim.o.background = is_dark and 'dark' or 'light' + +local ok, _ = pcall(function() + vim.cmd.colorscheme(is_dark and themes.dark or themes.light) +end) + +if not ok then + vim.cmd.colorscheme('habamax') +end diff --git a/lua/custom/themes.lua b/lua/custom/themes.lua new file mode 100644 index 0000000..29c1b3d --- /dev/null +++ b/lua/custom/themes.lua @@ -0,0 +1,4 @@ +return { + dark = 'monokai_soda', + light = 'solarized', +}