mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-13 10:54:40 +02:00
fix(autocmds): load autocmds during startup when argc > 0. Fixes #34
This commit is contained in:
parent
e405023530
commit
318b56c1c4
1 changed files with 15 additions and 9 deletions
|
@ -78,6 +78,7 @@ function M.setup(opts)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if vim.fn.argc() == 0 then
|
||||||
-- autocmds and keymaps can wait to load
|
-- autocmds and keymaps can wait to load
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
group = vim.api.nvim_create_augroup("LazyVim", { clear = true }),
|
group = vim.api.nvim_create_augroup("LazyVim", { clear = true }),
|
||||||
|
@ -87,6 +88,11 @@ function M.setup(opts)
|
||||||
M.load("keymaps")
|
M.load("keymaps")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
else
|
||||||
|
-- load them now so they affect the opened buffers
|
||||||
|
M.load("autocmds")
|
||||||
|
M.load("keymaps")
|
||||||
|
end
|
||||||
|
|
||||||
require("lazy.core.util").try(function()
|
require("lazy.core.util").try(function()
|
||||||
if type(M.colorscheme) == "function" then
|
if type(M.colorscheme) == "function" then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue