fix: prevent startup flash by setting colorscheme early and deferring oil
All checks were successful
Luacheck / luacheck (push) Successful in 11s
StyLua / stylua (push) Successful in 3s

This commit is contained in:
Jeremie Fraeys 2026-02-08 15:53:51 -05:00
parent 30587406dd
commit ecb3452195
No known key found for this signature in database
3 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,12 @@
-- 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
-- Set colorscheme early to prevent startup flash
vim.cmd('colorscheme monokai')
-- Install package manager
-- https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'

View file

@ -140,11 +140,13 @@ opt.formatoptions = opt.formatoptions
- '2' -- I'm not in gradeschool anymore
opt.iskeyword:append('_')
-- Open oil.nvim when opening a directory
-- Open oil.nvim when starting with a directory (defer to prevent flash)
vim.api.nvim_create_autocmd('VimEnter', {
callback = function()
if vim.fn.isdirectory(vim.fn.expand('%:p')) == 1 then
require('oil').open(vim.fn.expand('%:p'))
vim.schedule(function()
require('oil').open(vim.fn.expand('%:p'))
end)
end
end,
})

View file

@ -50,7 +50,7 @@ return {
update_interval = 2000,
set_dark_mode = function()
vim.api.nvim_set_option_value('background', 'dark', {})
vim.cmd('colorscheme monokai_soda')
vim.cmd('colorscheme monokai')
-- Apply custom highlight settings for Monokai
set_lsp_highlights('dark')