From a4e06120d299fdd7d48f4492ca61df572987a043 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 20 Nov 2024 16:56:06 -0300 Subject: [PATCH] update UI plugins --- config/nvim/lazy-lock.json | 3 +- .../nvim/lua/aleidk/plugins-base/dressing.lua | 10 - config/nvim/lua/aleidk/plugins-base/noice.lua | 123 ------------ config/nvim/lua/aleidk/plugins-base/ui.lua | 177 ++++++++++++++++++ 4 files changed, 179 insertions(+), 134 deletions(-) delete mode 100644 config/nvim/lua/aleidk/plugins-base/dressing.lua delete mode 100644 config/nvim/lua/aleidk/plugins-base/noice.lua create mode 100644 config/nvim/lua/aleidk/plugins-base/ui.lua diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 7bafe03..67d20b9 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -15,7 +15,7 @@ "copilot-lualine": { "branch": "main", "commit": "f40450c3e138766026327e7807877ea860618258" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, + "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, "friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" }, "gitsigns.nvim": { "branch": "main", "commit": "e9c4187c3774a46df2d086a66cf3a7e6bea4c432" }, "grapple.nvim": { "branch": "main", "commit": "7aedc261b05a6c030397c4bc26416efbe746ebf1" }, @@ -39,6 +39,7 @@ "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, "nvim-lspconfig": { "branch": "master", "commit": "216deb2d1b5fbf24398919228208649bbf5cbadf" }, + "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-treesitter": { "branch": "master", "commit": "7f4ac678770175cdf0d42c015f4a5b6e18b6cb33" }, "nvim-treesitter-context": { "branch": "master", "commit": "f56a1430f21334868a86eb980b12e0af55690e98" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, diff --git a/config/nvim/lua/aleidk/plugins-base/dressing.lua b/config/nvim/lua/aleidk/plugins-base/dressing.lua deleted file mode 100644 index 9d2a5e4..0000000 --- a/config/nvim/lua/aleidk/plugins-base/dressing.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - -- better imputs - "stevearc/dressing.nvim", - opts = { - input = { - -- handle by noice - enabled = false, - }, - }, -} diff --git a/config/nvim/lua/aleidk/plugins-base/noice.lua b/config/nvim/lua/aleidk/plugins-base/noice.lua deleted file mode 100644 index 0ab9d7c..0000000 --- a/config/nvim/lua/aleidk/plugins-base/noice.lua +++ /dev/null @@ -1,123 +0,0 @@ -return { - "folke/noice.nvim", - event = "VeryLazy", - dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - "MunifTanjim/nui.nvim", - }, - opts = { - presets = { - bottom_search = true, - -- command_palette = true, - long_message_to_split = true, - inc_rename = true, - }, - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - routes = { - { - filter = { - event = "msg_show", - any = { - { find = "%d+L, %d+B" }, - { find = "; after #%d+" }, - { find = "; before #%d+" }, - }, - }, - view = "mini", - }, - { - filter = { - event = "msg_show", - kind = "search_count", - }, - opts = { skip = true }, - }, - }, - views = { - cmdline_popup = { - position = { - row = 5, - col = "50%", - }, - size = { - width = 60, - height = "auto", - }, - }, - popupmenu = { - relative = "editor", - position = { - row = 8, - col = "50%", - }, - size = { - width = 60, - height = 10, - }, - border = { - style = "rounded", - padding = { 0, 1 }, - }, - win_options = { - winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, - }, - }, - notify = { - enabled = false, - }, - messages = { - enabled = false, - }, - }, - }, - -- stylua: ignore - keys = { - { - "", - function() require("noice").redirect(vim.fn.getcmdline()) end, - mode = "c", - desc = - "Redirect Cmdline" - }, - { - "unl", - function() require("noice").cmd("last") end, - desc = - "Noice Last Message" - }, - { - "unh", - function() require("noice").cmd("history") end, - desc = - "Noice History" - }, - { "una", function() require("noice").cmd("all") end, desc = "Noice All" }, - { "und", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, - { - "", - function() if not require("noice.lsp").scroll(4) then return "" end end, - silent = true, - expr = true, - desc = - "Scroll forward", - mode = { - "i", "n", "s" } - }, - { - "", - function() if not require("noice.lsp").scroll(-4) then return "" end end, - silent = true, - expr = true, - desc = - "Scroll backward", - mode = { - "i", "n", "s" } - }, - }, -} diff --git a/config/nvim/lua/aleidk/plugins-base/ui.lua b/config/nvim/lua/aleidk/plugins-base/ui.lua new file mode 100644 index 0000000..811a01a --- /dev/null +++ b/config/nvim/lua/aleidk/plugins-base/ui.lua @@ -0,0 +1,177 @@ +return { + { + -- better imputs + "stevearc/dressing.nvim", + opts = { + input = { + -- handle by noice + enabled = false, + }, + }, + }, + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + opts = { + presets = { + bottom_search = true, + long_message_to_split = true, + inc_rename = true, + lsp_doc_border = true, + }, + lsp = { + override = { + -- override the default lsp markdown formatter with Noice + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + -- override the lsp markdown formatter with Noice + ["vim.lsp.util.stylize_markdown"] = true, + -- override cmp documentation with Noice (needs the other options to work) + ["cmp.entry.get_documentation"] = true, + }, + message = { + view = "mini", + }, + progress = { + view = "mini_left" + } + }, + routes = { + { + filter = { + event = "msg_show", + kind = "", + find = "written", + }, + opts = { skip = true }, + }, + { + filter = { + event = "notify", + min_height = 15 + }, + view = 'popup' + }, + { + filter = { + event = "notify", + kind = "info" + }, + view = 'mini' + }, + }, + views = { + notify = { + merge = true + }, + cmdline_popup = { + position = { + row = 5, + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + mini_left = { + backend = "mini", + relative = "editor", + align = "left", + timeout = 2000, + reverse = true, + focusable = false, + position = { + row = -1, + col = 0, + }, + size = { + width = "auto", + height = "auto", + max_height = 10, + }, + border = { + style = "none", + }, + zindex = 60, + win_options = { + winbar = "", + foldenable = false, + winblend = 30, + winhighlight = { + Normal = "NoiceMini", + IncSearch = "", + CurSearch = "", + Search = "", + }, + }, + }, + }, + }, + -- stylua: ignore + keys = { + { + "", + function() require("noice").redirect(vim.fn.getcmdline()) end, + mode = "c", + desc = + "Redirect Cmdline" + }, + { + "unl", + function() require("noice").cmd("last") end, + desc = + "Noice Last Message" + }, + { + "unh", + function() require("noice").cmd("history") end, + desc = + "Noice History" + }, + { "una", function() require("noice").cmd("all") end, desc = "Noice All" }, + { "und", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, + { + "", + function() if not require("noice.lsp").scroll(4) then return "" end end, + silent = true, + expr = true, + desc = + "Scroll forward", + mode = { + "i", "n", "s" } + }, + { + "", + function() if not require("noice.lsp").scroll(-4) then return "" end end, + silent = true, + expr = true, + desc = + "Scroll backward", + mode = { + "i", "n", "s" } + }, + }, + } +}