diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/plugins/core/which-key.lua | 53 | ||||
-rw-r--r-- | lua/plugins/lsp/config.lua | 2 |
2 files changed, 5 insertions, 50 deletions
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 = { "<cmd>tabnew<cr>", "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 = { "<cmd>BufferNext<cr>", "Next" }, - p = { "<cmd>BufferPrevious<cr>", "Previous" }, - c = { "<cmd>BufferClose<cr>", "Close" }, - }, - l = { - name = "LSP", - a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Action" }, - f = { - "<cmd>lua vim.lsp.buf.format({ async = false, timeout_ms = 5000 })<cr>", - "Format", - }, - d = { "<cmd>lua vim.diagnostic.open_float()<cr>", "Diagnostic" }, - h = { "<cmd>lua vim.lsp.buf.hover()<cr>", "Help" }, - g = { - name = "Go to", - D = { - "<cmd>lua vim.lsp.buf.declaration()<cr>", - "Go to declaration", - }, - d = { "<cmd>lua vim.lsp.buf.definition()<cr>", "Go to definition" }, - i = { - "<cmd>lua vim.lsp.buf.definition()<cr>", - "Go to implementation", - }, - }, - }, - }, - - config = function(_, opts) - local wk = require("which-key") - wk.register(opts, { prefix = "<leader>" }) - 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. } diff --git a/lua/plugins/lsp/config.lua b/lua/plugins/lsp/config.lua index ef952b1..4a9469a 100644 --- a/lua/plugins/lsp/config.lua +++ b/lua/plugins/lsp/config.lua @@ -10,8 +10,10 @@ return { lsp_opts.capabilities.textDocument.completion.completionItem.snippetSupport = true require("lspconfig")[lsp].setup(lsp_opts) end + vim.keymap.set('n', 'grd', "<cmd>lua vim.diagnostic.open_float()<cr>", { desc = 'Diagnostics floating window' }) end, init = function() + -- Show who is emitting the diagnostic vim.diagnostic.config({ float = { source = "always", |