return { "folke/which-key.nvim", event = "VeryLazy", opts = {}, keys = { { "?", function() require("which-key").show({ global = false }) end, desc = "Buffer Local Keymaps (which-key)", }, }, config = function() local harpoon = require("harpoon") require("which-key").add({ { "t", group = "Telescope" }, { "o", group = "Open plugin", icon = { icon = "", color = "yellow" } }, { "r", group = "Refactoring", mode = { "n", "x" } }, { "v", group = "LSP Actions", icon = { icon = "󰅡" } }, { "l", "LspRestart", desc = "Restart LSP" }, { "", group = "Reload Plugins", icon = { icon = "" } }, { "w", "Lazy reload which-key.nvim", desc = "Reload Which-key" }, { "s", "source ~/.config/nvim/lua/haelnorr/snippets/lua.lua\ source ~/.config/nvim/lua/haelnorr/snippets/go.lua\ Lazy reload LuaSnip", desc = "Reload LuaSnip", }, { "l", "Lazy reload nvim-lspconfig", desc = "Reload LSP" }, -- Harpoon -- Quick jumps and show list { "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, }, { "", function() harpoon:list():select(1) end, }, { "", function() harpoon:list():select(2) end, }, { "", function() harpoon:list():select(3) end, }, { "", function() harpoon:list():select(4) end, }, -- Add files { "a", function() harpoon:list():add() end, desc = "Harpoon current file", mode = "n", icon = { icon = "󱡅", color = "blue" }, }, { "", function() harpoon:list():replace_at(1) end, desc = "Harpoon at file 1", mode = "n", icon = { icon = "󱡅", color = "blue" }, }, { "", function() harpoon:list():replace_at(2) end, desc = "Harpoon at file 2", mode = "n", icon = { icon = "󱡅", color = "blue" }, }, { "", function() harpoon:list():replace_at(3) end, desc = "Harpoon at file 3", mode = "n", icon = { icon = "󱡅", color = "blue" }, }, { "", function() harpoon:list():replace_at(4) end, desc = "Harpoon at file 4", mode = "n", icon = { icon = "󱡅", color = "blue" }, }, -- Custom binds { "y", [["+y]], desc = "Yank to system clipboard", mode = { "n", "v" }, icon = { icon = "", color = "yellow" }, }, { "Y", [["+Y]], desc = "Yank line to system clipboard", mode = "n", icon = { icon = "", color = "yellow" }, }, { "p", [["_dP]], desc = "Paste over selection, preserving buffer", mode = "x", icon = { icon = "", color = "yellow" }, }, { "d", [["_d]], desc = "Delete, preserving buffer", mode = { "n", "v" }, icon = { icon = "", color = "red" }, }, { "x", "!chmod +x %", silent = true, desc = "Make file executable", icon = { icon = "", color = "red" }, }, -- Conform { "f", function() require("conform").format({ async = true }) end, mode = "n", desc = "Format file", icon = { icon = "󰉼", color = "yellow" }, }, }) end, }