Undo swapped_map grouping

This commit is contained in:
ViViDboarder 2022-01-12 10:06:21 -08:00
parent 5a81e7d33c
commit aef826f76b

View File

@ -74,22 +74,21 @@ local function get_default_attach(override_capabilities)
-- Mappings
local opts = { noremap = true, silent = true }
local lsp_keymap = utils.swapped_map(utils.keymap_group("n", "<leader>l", opts, bufnr), function(lsp_keymap)
lsp_keymap("h", "<cmd>lua vim.lsp.buf.hover()<CR>")
lsp_keymap("rn", "<cmd>lua vim.lsp.buf.rename()<CR>")
lsp_keymap("e", "<cmd>lua vim.lsp.diagnostics.show_line_diagnostics()<CR>")
lsp_keymap("D", "<cmd>lua vim.lsp.buf.declaration()<CR>")
lsp_keymap("d", "<cmd>lua vim.lsp.buf.definition()<CR>")
lsp_keymap("t", "<cmd>lua vim.lsp.buf.type_definition()<CR>")
lsp_keymap("i", "<cmd>lua vim.lsp.buf.implementation()<CR>")
lsp_keymap("s", "<cmd>lua vim.lsp.buf.signature_help()<CR>")
lsp_keymap("wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
lsp_keymap("wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
lsp_keymap("wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
lsp_keymap("r", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
lsp_keymap("p", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
lsp_keymap("n", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
end)
local lsp_keymap = utils.keymap_group("n", "<leader>l", opts, bufnr)
lsp_keymap("h", "<cmd>lua vim.lsp.buf.hover()<CR>")
lsp_keymap("rn", "<cmd>lua vim.lsp.buf.rename()<CR>")
lsp_keymap("e", "<cmd>lua vim.lsp.diagnostics.show_line_diagnostics()<CR>")
lsp_keymap("D", "<cmd>lua vim.lsp.buf.declaration()<CR>")
lsp_keymap("d", "<cmd>lua vim.lsp.buf.definition()<CR>")
lsp_keymap("t", "<cmd>lua vim.lsp.buf.type_definition()<CR>")
lsp_keymap("i", "<cmd>lua vim.lsp.buf.implementation()<CR>")
lsp_keymap("s", "<cmd>lua vim.lsp.buf.signature_help()<CR>")
lsp_keymap("wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", opts)
lsp_keymap("wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", opts)
lsp_keymap("wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>", opts)
lsp_keymap("r", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
lsp_keymap("p", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
lsp_keymap("n", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)
-- Older keymaps
buf_set_keymap("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)