From 59f7c9510348988e0cdf70064df84c7928164d6b Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 11 Jun 2024 22:17:26 -0500 Subject: [PATCH] refactor(nvim): improve how `noice` setup is handled --- .../nvim/lua/plugins/configs/noice.lua | 107 +++++++++--------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua b/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua index b2139db7..07ad3c16 100644 --- a/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua +++ b/users/price/dots/.config/nvim/lua/plugins/configs/noice.lua @@ -2,61 +2,62 @@ return { { "folke/noice.nvim", lazy = false, - init = function() + config = function() + require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + presets = { + long_message_to_split = true, + command_palette = true, + }, + views = { + cmdline_popup = { + border = { + style = "none", + }, + position = { + row = "99%", + col = "0%", + }, + }, + }, + popupmenu = { + backend = "cmp", + }, + routes = { + { + filter = { event = "msg_show", find = "Hop .*:" }, + opts = { skip = true }, + }, + -- Ignore `written` message + { + filter = { event = "msg_show", find = '^".*" %d*L, %d*B written$' }, + opts = { skip = true }, + }, + -- Ignore `undo` message + { + filter = { event = "msg_show", find = "^%d+ .*; before #%d+ %d+.*ago$" }, + opts = { skip = true }, + }, + -- Ignore `redo` message + { + filter = { event = "msg_show", find = "^%d+ .*; after #%d+ %d+.*ago$" }, + opts = { skip = true }, + }, + { + view = "split", + filter = { event = "msg_show", min_height = 20 }, + }, + }, + }) + vim.opt.cmdheight = 0 end, - opts = { - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - presets = { - long_message_to_split = true, - command_palette = true, - }, - views = { - cmdline_popup = { - border = { - style = "none", - }, - position = { - row = "99%", - col = "0%", - }, - }, - }, - popupmenu = { - backend = "cmp", - }, - routes = { - { - filter = { event = "msg_show", find = "Hop .*:" }, - opts = { skip = true }, - }, - -- Ignore `written` message - { - filter = { event = "msg_show", find = '^".*" %d*L, %d*B written$' }, - opts = { skip = true }, - }, - -- Ignore `undo` message - { - filter = { event = "msg_show", find = "^%d+ .*; before #%d+ %d+.*ago$" }, - opts = { skip = true }, - }, - -- Ignore `redo` message - { - filter = { event = "msg_show", find = "^%d+ .*; after #%d+ %d+.*ago$" }, - opts = { skip = true }, - }, - { - view = "split", - filter = { event = "msg_show", min_height = 20 }, - }, - }, - }, dependencies = { "MunifTanjim/nui.nvim", {