@@ -67,8 +67,9 @@ return {
6767 --
6868 -- In this case, we create a function that lets us more easily define mappings specific
6969 -- for LSP related items. It sets the mode, buffer and description for us each time.
70- local map = function (keys , func , desc )
71- vim .keymap .set (' n' , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
70+ local map = function (keys , func , desc , mode )
71+ mode = mode or ' n'
72+ vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
7273 end
7374
7475 -- Jump to the definition of the word under your cursor.
@@ -102,7 +103,7 @@ return {
102103
103104 -- Execute a code action, usually your cursor needs to be on top of an error
104105 -- or a suggestion from your LSP for this to activate.
105- map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' )
106+ map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' , { ' n ' , ' x ' } )
106107
107108 -- WARN: This is not Goto Definition, this is Goto Declaration.
108109 -- For example, in C this would take you to the header.
0 commit comments