fix: prevent startup flash by setting colorscheme early and deferring oil
This commit is contained in:
parent
30587406dd
commit
ecb3452195
3 changed files with 14 additions and 3 deletions
9
init.lua
9
init.lua
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue