feat(keymaps): change code action keymaps

This commit is contained in:
Radu C. Martin 2025-02-21 20:13:00 +01:00
parent 43b000ba55
commit d4e27f5dd7
3 changed files with 4 additions and 1 deletions

View file

@ -7,7 +7,6 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
vim.keymap.set('n', '<leader>ld', vim.diagnostic.open_float, { desc = '[L]ine [D]iagnostic' })
-- Insert -- -- Insert --
-- Press jk fast to exit insert mode -- Press jk fast to exit insert mode

View file

@ -104,6 +104,9 @@ return {
-- Execute a code action, usually your cursor needs to be on top of an error -- 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. -- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
map('<leader>cd', vim.diagnostic.open_float, '[C]ode [D]iagnostic', { 'n', 'x' })
map('<leader>clr', vim.lsp.codelens.refresh, '[C]ode [L]ens [R]efresh', { 'n', 'x' })
map('<leader>cll', vim.lsp.codelens.run, '[C]ode [L]ens [L]aunch', { 'n', 'x' })
-- WARN: This is not Goto Definition, this is Goto Declaration. -- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header. -- For example, in C this would take you to the header.

View file

@ -57,6 +57,7 @@ return { -- Useful plugin to show you pending keybinds.
-- Document existing key chains -- Document existing key chains
spec = { spec = {
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } }, { '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
{ '<leader>cl', group = '[C]ode [L]ens', mode = { 'n', 'x' } },
{ '<leader>d', group = '[D]ocument' }, { '<leader>d', group = '[D]ocument' },
{ '<leader>r', group = '[R]ename' }, { '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' }, { '<leader>s', group = '[S]earch' },