aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/noice.lua
blob: 70e81e9a9bf02ffcd2dd64e178b66a78d924470e (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
return {
  "folke/noice.nvim",
  dependencies = {
    "MunifTanjim/nui.nvim",
  },
  event = "VeryLazy",
  opts = {
    lsp = {
      -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
      override = {
        ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
        ["vim.lsp.util.stylize_markdown"] = true,
        ["cmp.entry.get_documentation"] = true,
      },
    },
    -- -- you can enable a preset for easier configuration
    presets = {
      bottom_search = true, -- use a classic bottom cmdline for search
      --   command_palette = true, -- position the cmdline and popupmenu together
      long_message_to_split = true, -- long messages will be sent to a split
      -- inc_rename = false, -- enables an input dialog for inc-rename.nvim
      lsp_doc_border = true, -- add a border to hover docs and signature help
    },
    cmdline = {
      view = "cmdline",
    },
    messages = {
      enabled = true, -- enables the Noice messages UI
      view = "notify", -- default view for messages
      view_error = "notify", -- view for errors
      view_warn = "notify", -- view for warnings
      view_history = "messages", -- view for :messages
      view_search = false, -- view for search count messages. Set to `false` to disable
    },
    routes = {
      {
        view = "split",
        filter = {
          cmdline = "G",
        },
        opts = {
          enter = true,
          render = "plain",
          format = { "{message}" },
          replace = true,
          close = {
            events = { "BufLeave" },
            keys = { "q" },
          },
        },
      },
      {
        view = "split",
        filter = {
          cmdline = "Notifications",
        },
        opts = {
          enter = true,
          render = "plain",
          format = { "{message}" },
          replace = true,
          close = {
            events = { "BufLeave" },
            keys = { "q" },
          },
        },
      },
      {
        view = "mini",
        filter = {
          cmdline = "w",
        },
      },
      {
        view = "mini",
        filter = {
          find = "Config Change Detected. Reloading...",
        },
      },
      {
        view = "mini",
        filter = {
          any = {
            {
              event = "msg_show",
              find = "lines yanked",
            },
            {
              event = "msg_show",
              find = "more lines",
            },
            {
              event = "msg_show",
              find = "direnv:",
            },
            {
              find = "laravel.sail.",
            },
            {
              find = "Pattern not found",
            },
            {
              event = "msg_show",
              kind = "",
              find = "change;",
            },
          },
        },
      },
    },
  },
}