🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

init: delay startup notifications

robin 6f0d52cf 56452b8d

+49
+2
config/lua/ivy/init.lua
··· 1 + require("ivy.notifs").init() 2 + 1 3 local config_base = "ivy.config" 2 4 3 5 local load_cfg = function(name)
+47
config/lua/ivy/notifs.lua
··· 1 + local notifs = {} 2 + 3 + notifs.did_ui_enter = false 4 + 5 + ---@type any[] 6 + notifs.queue = nil 7 + 8 + notifs.nvim_echo = function(...) 9 + if notifs.did_ui_enter then 10 + return notifs.old_echo(...) 11 + end 12 + 13 + notifs.queue = notifs.queue or {} 14 + notifs.queue[#notifs.queue + 1] = { ... } 15 + end 16 + 17 + notifs.did_init = false 18 + 19 + notifs.init = function() 20 + if notifs.did_init or notifs.did_ui_enter then 21 + return 22 + end 23 + 24 + notifs.queue = {} 25 + 26 + notifs.old_echo = vim.api.nvim_echo 27 + vim.api.nvim_echo = notifs.nvim_echo 28 + 29 + vim.api.nvim_create_autocmd("UIEnter", { 30 + once = true, 31 + callback = function() 32 + notifs.did_ui_enter = true 33 + 34 + vim.api.nvim_echo = notifs.old_echo 35 + 36 + vim.schedule(function() 37 + for _, args in ipairs(notifs.queue) do 38 + vim.api.nvim_echo(unpack(args)) 39 + end 40 + end) 41 + end, 42 + }) 43 + 44 + notifs.did_init = true 45 + end 46 + 47 + return notifs