nvim: lsp: Remove mappings which now have defaults
- crn for rename - crr for code actions - <C-r> <C-r> (in Visual mode) for code actions - gr for references - <C-S> (in Insert mode) for signature help gq has already been mapped to formatexpr for a while now. See :help lsp-defaults. Drop our mapping of gq and use gf mapping for whole buffer formatting. This allows us to use gq to format selections using text objects.
This commit is contained in:
parent
dc40ccac1e
commit
f14b2060d8
|
@ -53,29 +53,18 @@ protocol.CompletionItemKind = {
|
|||
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/definition" , 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' },
|
||||
{ "textDocument/inlayHint" , 'n', 'gi' , '<cmd>lua InlayHintToggle()<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/formatting" , 'n', 'gf' , '<cmd>lua vim.lsp.buf.format({async=true})<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"
|
||||
|
|
Loading…
Reference in a new issue