From 4ade38347ce7dfe46d0cf38f4b2fe18fb8e1df41 Mon Sep 17 00:00:00 2001 From: aleidk Date: Wed, 25 Oct 2023 15:18:38 -0300 Subject: [PATCH] update key help config in nvim --- config/nvim/lua/aleidk/plugins/bufferline.lua | 2 + config/nvim/lua/aleidk/plugins/init.lua | 2 +- config/nvim/lua/aleidk/plugins/key-help.lua | 19 +++- config/nvim/lua/aleidk/plugins/lsp.lua | 6 +- config/nvim/lua/aleidk/plugins/noice.lua | 91 ++++++++++--------- 5 files changed, 69 insertions(+), 51 deletions(-) diff --git a/config/nvim/lua/aleidk/plugins/bufferline.lua b/config/nvim/lua/aleidk/plugins/bufferline.lua index c6d4130..70bc630 100644 --- a/config/nvim/lua/aleidk/plugins/bufferline.lua +++ b/config/nvim/lua/aleidk/plugins/bufferline.lua @@ -5,6 +5,8 @@ return { keys = { { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, { "bP", "BufferLineGroupClose ungrouped", desc = "Delete non-pinned buffers" }, + { "bh", "BufferLineMovePrev", desc = "Move buffer to right" }, + { "bl", "BufferLineMoveNext", desc = "Move buffer to left" }, { "", "BufferLineCyclePrev", desc = "Prev buffer" }, { "", "BufferLineCycleNext", desc = "Next buffer" }, }, diff --git a/config/nvim/lua/aleidk/plugins/init.lua b/config/nvim/lua/aleidk/plugins/init.lua index 49b9803..5bb4608 100644 --- a/config/nvim/lua/aleidk/plugins/init.lua +++ b/config/nvim/lua/aleidk/plugins/init.lua @@ -28,7 +28,7 @@ return { config = nil, keys = { { - "c", + "bc", function() require("bufdelete").bufdelete(0, true) end, diff --git a/config/nvim/lua/aleidk/plugins/key-help.lua b/config/nvim/lua/aleidk/plugins/key-help.lua index 3d62d45..f52b3b7 100644 --- a/config/nvim/lua/aleidk/plugins/key-help.lua +++ b/config/nvim/lua/aleidk/plugins/key-help.lua @@ -1,5 +1,5 @@ return { - "echasnovski/mini.nvim", + "echasnovski/mini.clue", version = "*", event = "VeryLazy", config = function() @@ -37,20 +37,33 @@ return { { mode = "x", keys = "z" }, }, + -- Add a "postkeys" value to activate those keys after others clues = { - -- Enhance this by adding descriptions for mapping groups miniclue.gen_clues.builtin_completion(), miniclue.gen_clues.g(), miniclue.gen_clues.marks(), miniclue.gen_clues.registers(), miniclue.gen_clues.windows(), miniclue.gen_clues.z(), + + { mode = "n", keys = "b", desc = "+Buffers" }, + { mode = "n", keys = "bh", postkeys = "b" }, + { mode = "n", keys = "bl", postkeys = "b" }, + { mode = "n", keys = "l", desc = "+LSP" }, + { mode = "n", keys = "f", desc = "+Find" }, + { mode = "n", keys = "g", desc = "+Git" }, + { mode = "n", keys = "w", desc = "+Workspace" }, + { mode = "n", keys = "u", desc = "+UI" }, + { mode = "n", keys = "un", desc = "+Noice" }, + { mode = "n", keys = "", desc = "+Harpoon" }, }, -- Clue window settings window = { -- Floating window config - config = {}, + config = { + width = "auto", + }, -- Delay before showing clue window delay = 200, diff --git a/config/nvim/lua/aleidk/plugins/lsp.lua b/config/nvim/lua/aleidk/plugins/lsp.lua index a7ae31d..855c58f 100644 --- a/config/nvim/lua/aleidk/plugins/lsp.lua +++ b/config/nvim/lua/aleidk/plugins/lsp.lua @@ -19,7 +19,7 @@ return { }, -- Additional lua configuration, makes nvim stuff amazing! - { "folke/neodev.nvim", opts = {} }, + { "folke/neodev.nvim", opts = {} }, }, config = function() @@ -40,8 +40,8 @@ return { vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) end - nmap("rn", vim.lsp.buf.rename, "[R]e[n]ame") - nmap("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") + nmap("lr", vim.lsp.buf.rename, "[R]e[n]ame") + nmap("la", vim.lsp.buf.code_action, "[C]ode [A]ction") nmap("gd", vim.lsp.buf.definition, "Go to definition") nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") diff --git a/config/nvim/lua/aleidk/plugins/noice.lua b/config/nvim/lua/aleidk/plugins/noice.lua index 92ee963..f1fb95d 100644 --- a/config/nvim/lua/aleidk/plugins/noice.lua +++ b/config/nvim/lua/aleidk/plugins/noice.lua @@ -1,44 +1,47 @@ return { - "folke/noice.nvim", - event = "VeryLazy", - 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", opts = { - background_colour = "#000000", - } }, - }, - opts = { - 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", - }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = true, - }, - }, + "folke/noice.nvim", + event = "VeryLazy", + 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", + opts = { + background_colour = "#000000", + } + }, + }, + opts = { + 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", + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = true, + }, + }, -- stylua: ignore keys = { { @@ -49,19 +52,19 @@ return { "Redirect Cmdline" }, { - "snl", + "unl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, { - "snh", + "unh", function() require("noice").cmd("history") end, desc = "Noice History" }, - { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, - { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, + { "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,