diff --git a/lua/lsp.lua b/lua/lsp.lua index eb6c689..d5beb9d 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -16,6 +16,15 @@ local on_attach = function(_, bufnr) nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed + nmap('f', function() -- https://stackoverflow.com/a/74303272 + vim.lsp.buf.code_action({ + filter = function(a) + return a.isPreferred + end, + apply = true + }) + end, 'code action: [F]ix' + ) nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')