nvim/lua/custom/plugins/notify.lua
Jeremie Fraeys b3b5702588
Some checks failed
Luacheck / luacheck (push) Successful in 11s
StyLua / stylua (push) Failing after 2s
perf: further startup optimizations - defer indent, luasnip, notify, oil, atac, auto-dark-mode
2026-02-08 15:30:13 -05:00

51 lines
1.5 KiB
Lua

return {
'rcarriga/nvim-notify',
event = 'VeryLazy',
opts = {
timeout = 5000,
stages = 'static',
},
config = function(_, opts)
local notify = require('notify')
notify.setup(opts)
-- Override vim.notify to filter out noisy LSP messages
local original_notify = vim.notify
vim.notify = function(msg, level, notify_opts)
-- Suppress Node.js warnings
if type(msg) == 'string' and msg:match('ExperimentalWarning: SQLite') then
return
end
if type(msg) == 'string' and msg:match('DeprecationWarning.*punycode') then
return
end
-- Suppress copilot errors (harmless race conditions)
if type(msg) == 'string' and msg:match('Cannot find request.*whilst attempting to cancel') then
return
end
if type(msg) == 'string' and msg:match('AbortError: The operation was aborted') then
return
end
if type(msg) == 'string' and msg:match('rate limit exceeded') then
return
end
if type(msg) == 'string' and msg:match('Rate limited by server') then
return
end
-- Suppress bashls parsing/formatting errors
if type(msg) == 'string' and msg:match('Error while parsing file://') then
return
end
if type(msg) == 'string' and msg:match('Error while formatting.*Shfmt') then
return
end
original_notify(msg, level, notify_opts)
end
-- Set as default notifier
vim.notify = notify
end,
}