nvim: add psoxizsh.lsp.keys

This is our inhouse overrides over LazyVim's key maps for the LSP on_attach
function.

Unfortunately there's no good way to do this, other than directly
mutating the key binds LazyVim creates
This commit is contained in:
Paul Stemmet 2024-08-08 12:09:36 +00:00
parent 0a15980464
commit 9add4b0481
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
return {
{ 'neovim/nvim-lspconfig',
opts = function(_, _)
local K = require("lazyvim.plugins.lsp.keymaps").get()
-- So this is a bit obtuse to set, because we have to match the order
-- provided by LazyVim, see the following for the offsets
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/lsp/keymaps.lua#L15
K[1][1] = '<leader>Ci' -- 'Lsp Info'
K[2][1] = 'gd' -- 'Goto Definition'
K[3][1] = 'gr' -- 'References'
K[4][1] = 'gI' -- 'Goto Implementation'
K[5][1] = 'gT' ; K[5].desc = 'Goto Type Definition'
K[6][1] = 'gD' -- 'Goto Declaration'
K[7][1] = 'K' -- 'Hover'
K[8][1] = 'gS' -- 'Signature Help'
K[9][2] = false -- 'Signature Help' (disable insert mode map)
K[10][1] = '<leader>.' -- 'Code Action'
K[11][1] = '<leader>r>' -- 'Run Codelens'
K[12][1] = '<leader>>' -- 'Refresh & Display Codelens'
K[13][1] = '<leader>rF' -- 'Rename File'
K[14][1] = '<leader>rn' -- 'Rename'
K[15][1] = '<leader>Ca' -- 'Source Action'
K[16][1] = ']]' -- 'Next Reference'
K[17][1] = '[[' -- 'Prev Reference'
K[18][2] = false -- 'Next Reference' (disable alt map)
K[19][2] = false -- 'Prev Reference' (disable alt map)
end
},
}