From d4e27f5dd7998cd0b540e86db418cf8522b5542a Mon Sep 17 00:00:00 2001 From: "Radu C. Martin" Date: Fri, 21 Feb 2025 20:13:00 +0100 Subject: [PATCH] feat(keymaps): change code action keymaps --- lua/config/keymaps.lua | 1 - lua/plugins/lsp.lua | 3 +++ lua/plugins/which-key.lua | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 2a12b9c..0ce401e 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -7,7 +7,6 @@ vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -vim.keymap.set('n', 'ld', vim.diagnostic.open_float, { desc = '[L]ine [D]iagnostic' }) -- Insert -- -- Press jk fast to exit insert mode diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 6b7e356..dbd1f6b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -104,6 +104,9 @@ return { -- Execute a code action, usually your cursor needs to be on top of an error -- or a suggestion from your LSP for this to activate. map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) + map('cd', vim.diagnostic.open_float, '[C]ode [D]iagnostic', { 'n', 'x' }) + map('clr', vim.lsp.codelens.refresh, '[C]ode [L]ens [R]efresh', { 'n', 'x' }) + map('cll', vim.lsp.codelens.run, '[C]ode [L]ens [L]aunch', { 'n', 'x' }) -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index c803c00..f543a81 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -57,6 +57,7 @@ return { -- Useful plugin to show you pending keybinds. -- Document existing key chains spec = { { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'cl', group = '[C]ode [L]ens', mode = { 'n', 'x' } }, { 'd', group = '[D]ocument' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' },