Make lspconfig mappings configurable.
This commit is contained in:
parent
1cd5150b70
commit
31e551af30
3 changed files with 46 additions and 25 deletions
|
|
@ -190,6 +190,27 @@ M.mappings.plugins = {
|
|||
esc_insertmode = { "jk" }, -- multiple mappings allowed
|
||||
},
|
||||
|
||||
lspconfig = {
|
||||
declaration = "gD",
|
||||
definition = "gd",
|
||||
hover = "K",
|
||||
implementation = "gi",
|
||||
signature_help = "gk",
|
||||
add_workspace_folder = "<leader>wa",
|
||||
remove_workspace_folder = "<leader>wr",
|
||||
list_workspace_folders = "<leader>wl",
|
||||
type_definition = "<leader>D",
|
||||
rename = "<leader>rn",
|
||||
code_action = "<leader>ca",
|
||||
references = "gr",
|
||||
show_line_diagnostics = "ge",
|
||||
goto_prev = "[d",
|
||||
goto_next = "]d",
|
||||
set_loclist = "<leader>q",
|
||||
formatting = "<leader>fm",
|
||||
range_code_action = "<leader>ca",
|
||||
},
|
||||
|
||||
nvimtree = {
|
||||
toggle = "<C-n>",
|
||||
focus = "<leader>e",
|
||||
|
|
|
|||
|
|
@ -138,6 +138,30 @@ M.dashboard = function()
|
|||
map("n", m.session_save, ":SessionSave <CR>")
|
||||
end
|
||||
|
||||
M.lspconfig = function()
|
||||
local m = plugin_maps.lspconfig
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
map("n", m.declaration, "<cmd>lua vim.lsp.buf.declaration()<CR>")
|
||||
map("n", m.definition, "<cmd>lua vim.lsp.buf.definition()<CR>")
|
||||
map("n", m.hover, "<cmd>lua vim.lsp.buf.hover()<CR>")
|
||||
map("n", m.implementation, "<cmd>lua vim.lsp.buf.implementation()<CR>")
|
||||
map("n", m.signature_help, "<cmd>lua vim.lsp.buf.signature_help()<CR>")
|
||||
map("n", m.add_workspace_folder, "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
|
||||
map("n", m.remove_workspace_folder, "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
|
||||
map("n", m.list_workspace_folders, "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
|
||||
map("n", m.type_definition, "<cmd>lua vim.lsp.buf.type_definition()<CR>")
|
||||
map("n", m.rename, "<cmd>lua vim.lsp.buf.rename()<CR>")
|
||||
map("n", m.code_action, "<cmd>lua vim.lsp.buf.code_action()<CR>")
|
||||
map("n", m.references, "<cmd>lua vim.lsp.buf.references()<CR>")
|
||||
map("n", m.show_line_diagnostics, "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>")
|
||||
map("n", m.goto_prev, "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>")
|
||||
map("n", m.goto_next, "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>")
|
||||
map("n", m.set_loclist, "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>")
|
||||
map("n", m.formatting, "<cmd>lua vim.lsp.buf.formatting()<CR>")
|
||||
map("v", m.range_code_action, "<cmd>lua vim.lsp.buf.range_code_action()<CR>")
|
||||
end
|
||||
|
||||
M.nvimtree = function()
|
||||
map("n", plugin_maps.nvimtree.toggle, ":NvimTreeToggle <CR>")
|
||||
map("n", plugin_maps.nvimtree.focus, ":NvimTreeFocus <CR>")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue