summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/custom/plugins/nvim-notify.lua
blob: bf27720aa11bd5e4b38e3eee47676ec858e5a0ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
return {
    'rcarriga/nvim-notify',
    event = 'VeryLazy',
    keys = {
        {
            '<leader>nd',
            function()
                require('notify').dismiss({ silent = true, pending = true })
            end,
            desc = '[N]otify [D]ismiss All',
        },
    },
    opts = function()
        -- Filter messages
        local filtered_messages = { 'No information available', 'No code actions available' }
        ---@diagnostic disable-next-line: duplicate-set-field
        vim.notify = function(message, level, opts)
            opts = opts or {}
            for _, msg in ipairs(filtered_messages) do
                if message == msg then
                    return
                end
            end
            return require('notify')(message, level, opts)
        end
        return {
            fps = 60,
            render = 'default',
            timeout = 500,
            topDown = true,
        }
    end,
}