feat: add new configuration modules
- Add preconfig.lua for early initialization - Add themes.lua for theme management
This commit is contained in:
parent
5851bbee73
commit
f4d20a2ce2
2 changed files with 31 additions and 0 deletions
27
lua/config/preconfig.lua
Executable file
27
lua/config/preconfig.lua
Executable file
|
|
@ -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
|
||||
4
lua/custom/themes.lua
Normal file
4
lua/custom/themes.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
dark = 'monokai_soda',
|
||||
light = 'solarized',
|
||||
}
|
||||
Loading…
Reference in a new issue