Rename Lsp keymap descriptions to LSP (#2792)
* rename Lsp keymap descriptions to LSP * fix error * refactor LSP in description
This commit is contained in:
parent
1295e9eafa
commit
adeecf701e
@ -5,29 +5,29 @@ local conf = require("nvconfig").ui.lsp
|
|||||||
-- export on_attach & capabilities
|
-- export on_attach & capabilities
|
||||||
M.on_attach = function(client, bufnr)
|
M.on_attach = function(client, bufnr)
|
||||||
local function opts(desc)
|
local function opts(desc)
|
||||||
return { buffer = bufnr, desc = desc }
|
return { buffer = bufnr, desc = "LSP " .. desc }
|
||||||
end
|
end
|
||||||
|
|
||||||
map("n", "gD", vim.lsp.buf.declaration, opts "Lsp Go to declaration")
|
map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration")
|
||||||
map("n", "gd", vim.lsp.buf.definition, opts "Lsp Go to definition")
|
map("n", "gd", vim.lsp.buf.definition, opts "Go to definition")
|
||||||
map("n", "K", vim.lsp.buf.hover, opts "Lsp hover information")
|
map("n", "K", vim.lsp.buf.hover, opts "hover information")
|
||||||
map("n", "gi", vim.lsp.buf.implementation, opts "Lsp Go to implementation")
|
map("n", "gi", vim.lsp.buf.implementation, opts "Go to implementation")
|
||||||
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Lsp Show signature help")
|
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Show signature help")
|
||||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Lsp Add workspace folder")
|
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder")
|
||||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Lsp Remove workspace folder")
|
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder")
|
||||||
|
|
||||||
map("n", "<leader>wl", function()
|
map("n", "<leader>wl", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts "Lsp List workspace folders")
|
end, opts "List workspace folders")
|
||||||
|
|
||||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Lsp Go to type definition")
|
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Go to type definition")
|
||||||
|
|
||||||
map("n", "<leader>ra", function()
|
map("n", "<leader>ra", function()
|
||||||
require "nvchad.lsp.renamer"()
|
require "nvchad.lsp.renamer"()
|
||||||
end, opts "Lsp NvRenamer")
|
end, opts "NvRenamer")
|
||||||
|
|
||||||
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Lsp Code action")
|
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Code action")
|
||||||
map("n", "gr", vim.lsp.buf.references, opts "Lsp Show references")
|
map("n", "gr", vim.lsp.buf.references, opts "Show references")
|
||||||
|
|
||||||
-- setup signature popup
|
-- setup signature popup
|
||||||
if conf.signature and client.server_capabilities.signatureHelpProvider then
|
if conf.signature and client.server_capabilities.signatureHelpProvider then
|
||||||
|
Loading…
Reference in New Issue
Block a user