local M = {} local map = vim.keymap.set function M.setup() map("n", "gA", vim.lsp.buf.code_action, { desc = "Code action" }) map("n", "gd", "Telescope lsp_definitions", { desc = "Definitions" }) map("n", "gDc", "Telescope lsp_implementations", { desc = "Implementations" }) map("n", "gDf", "Telescope lsp_definitions", { desc = "Definitions" }) map("n", "gF", "edit ", { desc = "Edit file under cursor" }) map("n", "gT", "Telescope lsp_type_definitions", { desc = "Type definitions" }) map("n", "gb", "Gitsigns blame_line", { desc = "Blame line" }) map("n", "gb", "Gitsigns blame", { desc = "Git blame" }) map("n", "gi", "Telescope lsp_implementations", { desc = "Implementations" }) map("n", "gj", "Telescope jumplist", { desc = "Jumplist" }) map("n", "gr", "Telescope lsp_references", { desc = "References" }) map("n", "gs", vim.lsp.buf.signature_help, { desc = "Signature help" }) map("n", "ca", vim.lsp.buf.code_action, { desc = "Code action" }) map("n", "ch", vim.lsp.buf.signature_help, { desc = "Signature help" }) map("n", "cR", vim.lsp.buf.rename, { desc = "Rename" }) map("n", "cr", "Telescope lsp_references", { desc = "References" }) map("n", "cs", "Telescope lsp_document_symbols", { desc = "Document symbols" }) map("n", "ct", "Telescope lsp_type_definitions", { desc = "Type definitions" }) map("n", "cw", "Telescope lsp_dynamic_workspace_symbols", { desc = "Workspace symbols" }) map("n", "ci", "Telescope lsp_implementations", { desc = "Implementations" }) map("n", "cci", "Telescope lsp_incoming_calls", { desc = "Incoming calls" }) map("n", "cco", "Telescope lsp_outgoing_calls", { desc = "Outgoing calls" }) map("n", "cd", "Telescope diagnostics theme=dropdown layout_config={width=0.8}", { desc = "Diagnostics", }) map("n", "cDs", "Telescope diagnostics theme=dropdown layout_config={width=0.8}", { desc = "Diagnostics", }) map("n", "cDn", function() vim.diagnostic.jump({ count = 1, float = true }) end, { desc = "Next diagnostic" }) map("n", "cDp", function() vim.diagnostic.jump({ count = -1, float = true }) end, { desc = "Previous diagnostic" }) map("n", "cl", vim.diagnostic.setloclist, { desc = "Diagnostics to location list" }) map("n", "Clr", "LspRestart", { desc = "Restart LSP" }) map("n", "cPs", function() vim.cmd("!pyright --createstub " .. vim.fn.expand("")) end, { desc = "Generate Python stub" }) end return M