map lsp, goto {tdDri}, action {Ra}, diag {npq}
This commit is contained in:
parent
fdab14f6dc
commit
e4de3f2670
|
@ -15,6 +15,7 @@ function setup_keymap_lsp()
|
||||||
-- Buffer local mappings.
|
-- Buffer local mappings.
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
local opts = { buffer = ev.buf }
|
local opts = { buffer = ev.buf }
|
||||||
|
vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, opts)
|
||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||||
|
@ -26,10 +27,9 @@ function setup_keymap_lsp()
|
||||||
vim.keymap.set("n", "<leader>wl", function()
|
vim.keymap.set("n", "<leader>wl", function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts)
|
end, opts)
|
||||||
vim.keymap.set("n", "<leader>D", vim.lsp.buf.type_definition, opts)
|
vim.keymap.set("n", "gR", vim.lsp.buf.rename, opts)
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
vim.keymap.set({ "n", "v" }, "ga", vim.lsp.buf.code_action, opts)
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
|
vim.keymap.set("n", "g=", function()
|
||||||
vim.keymap.set("n", "<leader>f", function()
|
|
||||||
vim.lsp.buf.format { async = true }
|
vim.lsp.buf.format { async = true }
|
||||||
end, opts)
|
end, opts)
|
||||||
end,
|
end,
|
||||||
|
@ -92,10 +92,13 @@ return {
|
||||||
setup_keymap_lsp()
|
setup_keymap_lsp()
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>e", vim.diagnostic.open_float, mode = "n" },
|
{ "gs", "<cmd>LspStart<cr>", mode = "n" },
|
||||||
{ "[d", vim.diagnostic.goto_prev, mode = "n" },
|
{ "gS", "<cmd>LspStop<cr>", mode = "n" },
|
||||||
{ "]d", vim.diagnostic.goto_next, mode = "n" },
|
{ "gI", "<cmd>LspInfo<cr>", mode = "n" },
|
||||||
{ "<leader>q", vim.diagnostic.setloclist, mode = "n" }
|
{ "ge", vim.diagnostic.open_float, mode = "n" },
|
||||||
|
{ "gp", vim.diagnostic.goto_prev, mode = "n" },
|
||||||
|
{ "gn", vim.diagnostic.goto_next, mode = "n" },
|
||||||
|
{ "gq", vim.diagnostic.setloclist, mode = "n" }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue