From 6d16e8bdb7bfdd77e81ff0f8f0032325103d6466 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Tue, 9 Jan 2024 11:47:46 -0500 Subject: [PATCH] Add noice for the popup cmdline window --- .../files/nvim/lua/plugins/noice.lua | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 modules/home-manager/files/nvim/lua/plugins/noice.lua diff --git a/modules/home-manager/files/nvim/lua/plugins/noice.lua b/modules/home-manager/files/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..cdd3c45 --- /dev/null +++ b/modules/home-manager/files/nvim/lua/plugins/noice.lua @@ -0,0 +1,61 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + cmdline = { enabled = true }, + messages = { enabled = false }, + + 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, + }, + }, + + views = { + cmdline_popup = { + position = { + row = "50%", + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = "61%", + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + }) + end, +}