improving startup time by using lazy loading or filetype loading
This commit is contained in:
parent
bdb655c5a1
commit
7f1b34fd6f
62 changed files with 1285 additions and 561 deletions
19
lua/custom/plugins/auto-dark-mode.lua
Executable file
19
lua/custom/plugins/auto-dark-mode.lua
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
'f-person/auto-dark-mode.nvim',
|
||||
event = 'VimEnter', -- Lazy load on VimEnter event
|
||||
opts = {
|
||||
update_interval = 1000, -- Check for mode change every second
|
||||
set_dark_mode = function()
|
||||
vim.cmd('colorscheme monokai')
|
||||
vim.cmd('set background=dark') -- Ensure the background is set correctly
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.cmd('colorscheme solarized')
|
||||
vim.cmd('set background=light')
|
||||
end,
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('auto-dark-mode').setup(opts)
|
||||
end
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue