From 5b7f52d7f85b69c7dbb5b2951c67d7fcc90fe94f Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Fri, 17 Jan 2025 23:01:52 +0100 Subject: simplify whichkey config most lsp keybindings are now by default under gr so no need to set them manually see: https://github.com/neovim/neovim/pull/28650 and https://neovim.io/doc/user/lsp.html --- lua/plugins/core/which-key.lua | 53 +++--------------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) (limited to 'lua/plugins/core/which-key.lua') diff --git a/lua/plugins/core/which-key.lua b/lua/plugins/core/which-key.lua index 3c4a95b..8ae0406 100644 --- a/lua/plugins/core/which-key.lua +++ b/lua/plugins/core/which-key.lua @@ -5,54 +5,7 @@ return { vim.o.timeout = true vim.o.timeoutlen = 300 end, - - opts = { - f = { name = "File" }, - t = { - name = "Tab", - c = { "tabnew", "Create" }, - ["1"] = { "1gt", "1" }, - ["2"] = { "2gt", "2" }, - ["3"] = { "3gt", "3" }, - ["4"] = { "4gt", "4" }, - ["5"] = { "5gt", "5" }, - ["6"] = { "6gt", "6" }, - ["7"] = { "7gt", "7" }, - ["8"] = { "8gt", "8" }, - ["9"] = { "9gt", "9" }, - }, - b = { - name = "Buffer", - n = { "BufferNext", "Next" }, - p = { "BufferPrevious", "Previous" }, - c = { "BufferClose", "Close" }, - }, - l = { - name = "LSP", - a = { "lua vim.lsp.buf.code_action()", "Action" }, - f = { - "lua vim.lsp.buf.format({ async = false, timeout_ms = 5000 })", - "Format", - }, - d = { "lua vim.diagnostic.open_float()", "Diagnostic" }, - h = { "lua vim.lsp.buf.hover()", "Help" }, - g = { - name = "Go to", - D = { - "lua vim.lsp.buf.declaration()", - "Go to declaration", - }, - d = { "lua vim.lsp.buf.definition()", "Go to definition" }, - i = { - "lua vim.lsp.buf.definition()", - "Go to implementation", - }, - }, - }, - }, - - config = function(_, opts) - local wk = require("which-key") - wk.register(opts, { prefix = "" }) - end, + -- Don't set keymaps here using the plugin spec or elsewhere using the + -- wk.add fn. Instead use normal vim.keymap.set and set a description. + -- This way everything without this plugin. } -- cgit v1.2.3