native-lsp fixes
This commit is contained in:
1 parent
5b71bcc21e
commit
8d03d7f0ed
4 files changed
+121
-8
No files matched your search
@@ -565,6 +565,28 @@ if not NV_DARCULA_ENABLE_COC then
|
||||
function M.lsp()
|
||||
local opts = {remap = false, silent = true}
|
||||
|
||||
km.vmap(
|
||||
km.leader "gs",
|
||||
function()
|
||||
telescope_builtin.live_grep({default_text = utils.get_visual_text()})
|
||||
end,
|
||||
opts
|
||||
)
|
||||
km.nmap(
|
||||
km.leader "gs",
|
||||
function()
|
||||
telescope_builtin.live_grep({default_text = utils.cword()})
|
||||
end,
|
||||
opts
|
||||
)
|
||||
km.map(
|
||||
km.leader "is",
|
||||
function()
|
||||
local status = vim.lsp.status()
|
||||
vim.notify(status ~= "" and status or "None", vim.log.levels.INFO)
|
||||
end,
|
||||
opts
|
||||
)
|
||||
km.nmap(km.leader "dl", vim.diagnostic.setloclist, opts)
|
||||
km.nmap(km.leader "dw", telescope_builtin.diagnostics, opts)
|
||||
km.nmap(km.leader "fs", telescope_builtin.lsp_document_symbols, opts)
|
||||
@@ -635,14 +657,41 @@ if not NV_DARCULA_ENABLE_COC then
|
||||
|
||||
local opts = {remap = false, silent = true, buffer = ev.buf}
|
||||
|
||||
km.set({"n", "x"}, km.leader "a", vim.lsp.buf.code_action, opts)
|
||||
km.nmap(km.leader "ac", vim.lsp.buf.code_action, opts)
|
||||
km.nmap(km.leader "aw", vim.lsp.buf.code_action, opts)
|
||||
km.nmap(km.leader "ca", vim.lsp.buf.code_action, opts)
|
||||
km.nmap(km.leader "cl", vim.lsp.codelens.run, opts)
|
||||
km.nmap(km.leader "gD", vim.lsp.buf.declaration, opts)
|
||||
km.nmap(km.leader "gd", telescope_builtin.lsp_definitions, opts)
|
||||
km.nmap(km.leader "gi", telescope_builtin.lsp_implementations, opts)
|
||||
km.nmap(km.leader "gr", telescope_builtin.lsp_references, opts)
|
||||
km.nmap(km.leader "gy", telescope_builtin.lsp_type_definitions, opts)
|
||||
km.nmap(km.leader "rn", vim.lsp.buf.rename, opts)
|
||||
if client.name == "clangd" then
|
||||
km.nmap(
|
||||
km.leader "gh",
|
||||
function()
|
||||
vim.cmd("LspClangdSwitchSourceHeader")
|
||||
end,
|
||||
opts
|
||||
)
|
||||
end
|
||||
km.nmap(
|
||||
km.leader "qf",
|
||||
function()
|
||||
vim.lsp.buf.code_action({apply = true, context = {only = {"quickfix"}}})
|
||||
end,
|
||||
opts
|
||||
)
|
||||
km.set(
|
||||
{"n", "x"},
|
||||
km.leader "rs",
|
||||
function()
|
||||
vim.lsp.buf.selection_range(1)
|
||||
end,
|
||||
opts
|
||||
)
|
||||
|
||||
km.vmap(
|
||||
km.leader "ac",
|
||||
|
||||
Reference in new issue
Block a user