@@ -456,8 +456,9 @@ require('lazy').setup({
456456 --
457457 -- In this case, we create a function that lets us more easily define mappings specific
458458 -- for LSP related items. It sets the mode, buffer and description for us each time.
459- local map = function (keys , func , desc )
460- vim .keymap .set (' n' , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
459+ local map = function (keys , func , desc , mode )
460+ mode = mode or ' n'
461+ vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
461462 end
462463
463464 -- Jump to the definition of the word under your cursor.
@@ -491,7 +492,7 @@ require('lazy').setup({
491492
492493 -- Execute a code action, usually your cursor needs to be on top of an error
493494 -- or a suggestion from your LSP for this to activate.
494- map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
495+ map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' , { ' n ' , ' x ' } )
495496
496497 -- WARN: This is not Goto Definition, this is Goto Declaration.
497498 -- For example, in C this would take you to the header.
0 commit comments