folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to disable popup messages?

andyl opened this issue · comments

After studying the documentation, I could not figure out how to disable common popup messages.

Just one example: When I turn off search highlights, I get a green notification with title = "Message" and content = "nohlsearch".

There are formatters, routes, filters, views, etc. Which do I use to disable specific info and error messages?

I don't understand how it all fits together...

I want to disable messages based on their content.

This is probably a very basic question - sorry about that! Once I figure it out I'll issue an PR to improve Noice documentation...

And the examples in the wiki didn't work? What did you try when you studied the docs?

No I could not find a wiki example that solved my use case. For example, I tried the config below, modified for my message text. No luck!

from https://github.com/folke/noice.nvim/wiki/Configuration-Recipes#hide-written-messages-1 ...

  require("noice").setup({
    routes = {
      {
        filter = {
          event = "msg_show",
          kind = "",
          find = "nohlsearch",
        },
        opts = { skip = true },
      },
    },
  })

If you know the solution, please just reveal it! 😆

Don't know the solution^^ I would've tried the same as you, but this config does nothing for me.

I also tried something like this:

  require("noice").setup({
    routes = {
      {
        filter = {
          event = "msg_show",
          find = "foo",
        },
        opts = { skip = true },
      },
    },
  })

But :lua vim.notify("foo") is still shown, so idk whats going on.

Thanks for giving it a try...

This should work:

  require("noice").setup({
    routes = {
      {
        filter = {
          event = "notify",
          find = "nohlsearch",
        },
        opts = { skip = true },
      },
    },
  })

@dadav - THANKS!

Also FYI - to filter multiple terms I used multiple expressions like this...

require("noice").setup({
  routes = {
    { filter = { event = "notify", find = "ping" }, opts = { skip = true } },
    { filter = { event = "notify", find = "pong" }, opts = { skip = true } },
    { filter = { find = "alternate" }, opts = { skip = true } },  
  },
})