rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.91k stars 74 forks source link

How to override the builtin notifications #192

Closed Corgile closed 1 year ago

Corgile commented 1 year ago

Overriding/customizing notification is indeed needed in since sometimes the messages can be so long that cover contents for a long time.

image

my onsave action is implemented by :

keycap('n', '<C-S>', '<CMD>lua vim.api.notify(\"current file is saved!\")<CR>')
rcarriga commented 1 year ago

Duplicate of https://github.com/rcarriga/nvim-notify/issues/190, see that issue for solutions

RAprogramm commented 10 months ago

If long message is problem - you can show only filename in notification body. I use this keybind with which-key.

    ['<c-s>'] = {
      function()
        vim.cmd('silent! wa')
        vim.notify(
          'File "' .. vim.fn.expand('%:t') .. '" was saved',
          2,
          { title = 'Saved', icon = '✓' }
        )
      end,
      'Save file ',
    },