nvim: lsp: Drop LSP default mappings

See :help lsp-defaults.
This commit is contained in:
Sanchayan Maity 2024-10-22 13:09:28 +05:30
parent ae7a18490d
commit a4073a924c
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -58,27 +58,19 @@ local lsp_augroup_id = vim.api.nvim_create_augroup("LSP", { clear = true })
local lsp_key_mappings = {
{ "textDocument/definition" , 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' },
{ "textDocument/definition" , 'n', 'gd' , '<cmd>lua vim.lsp.buf.definition()<CR>' },
--{ "textDocument/declaration" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.declaration()<CR>' },
{ "textDocument/typeDefinition" , 'n', '<C-k>' , '<cmd>lua vim.lsp.buf.type_definition()<CR>' },
{ "textDocument/implementation" , 'n', 'gD' , '<cmd>lua vim.lsp.buf.implementation()<CR>' },
{ "textDocument/documentSymbol" , 'n', '1gd' , '<cmd>lua vim.lsp.buf.document_symbol()<CR>' },
{ "workspace/symbol" , 'n', '1gD' , '<cmd>lua vim.lsp.buf.workspace_symbol()<CR>' },
{ "textDocument/signatureHelp" , 'n', '<Leader>S', '<cmd>lua vim.lsp.buf.signature_help()<CR>' },
{ "textDocument/rename" , 'n', 'gR' , '<cmd>lua vim.lsp.buf.rename()<CR>' },
{ "textDocument/inlayHint" , 'n', 'gi' , '<cmd>lua InlayHintToggle()<CR>' },
{ "textDocument/rangeFormatting", 'x', 'gq', '<cmd>lua vim.lsp.buf.format({async=true})<CR>' },
{ "textDocument/formatting" , 'n', 'gq', '<cmd>lua vim.lsp.buf.format({async=true})<CR>' },
{ "textDocument/codeAction", 'n', 'ga' , '<cmd>lua vim.lsp.buf.code_action()<CR>' },
{ "textDocument/codeAction", 'v', 'ga' , '<cmd>lua vim.lsp.buf.code_action()<CR>' },
{ "textDocument/codeAction", 'n', '<Leader>r', '<cmd>lua vim.lsp.buf.code_action{only = \'refactor\' }<CR>' },
{ "textDocument/codeAction", 'v', '<Leader>r', '<cmd>lua vim.lsp.buf.code_action{only = \'refactor\' }<CR>' },
{ "textDocument/codeLens", 'n', '<LocalLeader>l', '<cmd>lua vim.lsp.codelens.run()<CR>' },
{ "textDocument/codeLens", 'n', '<LocalLeader>L', '<cmd>lua vim.lsp.codelens.clear()<CR>' },
{ "textDocument/references", 'n', 'gr', '<cmd>lua vim.lsp.buf.references({ includeDeclaration = false })<CR>'},
}
local CODE_ACTION_AVAILABLE = "CodeActionAvailable"