Skip to content

Commit b65d308

Browse files
committed
feat(event): custom lazy event hook for distros
1 parent 303a3ed commit b65d308

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/lazy/core/handler/event.lua

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ M.triggers = {
2323
BufReadPost = "BufReadPre",
2424
}
2525

26+
-- A table of mappings for custom events
27+
-- Can be used by distros to add custom events (see usage in LazyVim)
28+
---@type table<string, LazyEvent>
29+
M.mappings = {
30+
VeryLazy = { id = "VeryLazy", event = "User", pattern = "VeryLazy" },
31+
-- Example:
32+
-- LazyFile = { id = "LazyFile", event = { "BufReadPost", "BufNewFile", "BufWritePre" } },
33+
}
34+
M.mappings["User VeryLazy"] = M.mappings.VeryLazy
35+
2636
M.group = vim.api.nvim_create_augroup("lazy_handler_event", { clear = true })
2737

2838
---@param spec LazyEventSpec

0 commit comments

Comments
 (0)