feat(event): custom lazy event hook for distros

This commit is contained in:
Folke Lemaitre 2023-10-11 14:24:40 +02:00
parent 303a3ed6a8
commit b65d308662
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,16 @@ M.triggers = {
BufReadPost = "BufReadPre", BufReadPost = "BufReadPre",
} }
-- A table of mappings for custom events
-- Can be used by distros to add custom events (see usage in LazyVim)
---@type table<string, LazyEvent>
M.mappings = {
VeryLazy = { id = "VeryLazy", event = "User", pattern = "VeryLazy" },
-- Example:
-- LazyFile = { id = "LazyFile", event = { "BufReadPost", "BufNewFile", "BufWritePre" } },
}
M.mappings["User VeryLazy"] = M.mappings.VeryLazy
M.group = vim.api.nvim_create_augroup("lazy_handler_event", { clear = true }) M.group = vim.api.nvim_create_augroup("lazy_handler_event", { clear = true })
---@param spec LazyEventSpec ---@param spec LazyEventSpec