nvim/lua/config/preconfig.lua
Jeremie Fraeys f4d20a2ce2
feat: add new configuration modules
- Add preconfig.lua for early initialization
- Add themes.lua for theme management
2026-03-23 20:31:21 -04:00

27 lines
839 B
Lua
Executable file

-- 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