Skip to content

Commit d63932d

Browse files
byrmshhooks-nathanel
authored andcommitted
Include visual mode in LSP code action keymap (nvim-lua#1060) (nvim-lua#1064)
1 parent 080b674 commit d63932d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ require('lazy').setup({
340340
}
341341

342342
-- Document existing key chains
343-
spec = {
344-
{ '<leader>c', group = '[C]ode' },
343+
require('which-key').add {
344+
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
345345
{ '<leader>d', group = '[D]ocument' },
346346
{ '<leader>r', group = '[R]ename' },
347347
{ '<leader>s', group = '[S]earch' },
@@ -569,7 +569,7 @@ require('lazy').setup({
569569

570570
-- Execute a code action, usually your cursor needs to be on top of an error
571571
-- or a suggestion from your LSP for this to activate.
572-
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
572+
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
573573

574574
-- WARN: This is not Goto Definition, this is Goto Declaration.
575575
-- For example, in C this would take you to the header.

0 commit comments

Comments
 (0)