return { { "mfussenegger/nvim-dap", init = function() local signs = { DapBreakpoint = { text = "", texthl = "DapBreakpoint" }, DapBreakpointCondition = { text = "", texthl = "DapBreakpointCondition" }, DapBreakpointRejected = { text = "", texthl = "DapBreakpointRejected" }, DapLogPoint = { text = "", texthl = "DapLogPoint" }, DapStopped = { text = "", texthl = "DapStopped" }, } for name, sign in pairs(signs) do vim.fn.sign_define(name, sign) end end, config = function() local dap = require("dap") dap.adapters.lldb = { type = "executable", command = "/Library/Developer/CommandLineTools/usr/bin/lldb-dap", } end, keys = { { "", function() local dap = require("dap") if dap.session() then dap.continue() return end pcall(function() require("overseer").close() end) local cwd = vim.fn.getcwd() local launch_json_path = cwd .. "/.vscode/launch.json" if vim.fn.filereadable(launch_json_path) == 1 then dap.configurations.c = {} dap.configurations.cpp = {} dap.configurations.rust = {} local ok, vscode = pcall(require, "dap.ext.vscode") if ok then vscode.load_launchjs(launch_json_path, { lldb = { "c", "cpp", "rust" }, cppdbg = { "c", "cpp" }, gdb = { "c", "cpp" }, }) end local ft = vim.bo.filetype local configs = dap.configurations[ft] or {} if #configs == 1 then dap.run(configs[1]) return elseif #configs > 1 then vim.ui.select(configs, { prompt = "Select debug configuration:", format_item = function(c) return c.name end, }, function(selected) if selected then dap.run(selected) end end) return end end dap.continue() end, desc = "Debug: Start / Continue", }, { "", function() require("dap").toggle_breakpoint() end, desc = "Toggle breakpoint", }, { "", function() require("dap").step_over() end, desc = "Step over", }, { "", function() require("dap").step_into() end, desc = "Step into", }, { "", function() require("dap").step_out() end, desc = "Step out", }, { "q", function() require("dap").terminate() end, desc = "Terminate debugging", }, { "dh", function() require("dap.ui.widgets").hover() end, desc = "Debugger hover", }, }, }, { "rcarriga/nvim-dap-ui", opts = { layouts = { { elements = { { id = "breakpoints", size = 0.25 }, { id = "stacks", size = 0.25 }, { id = "watches", size = 0.25 }, }, position = "left", size = 45, }, { elements = { { id = "scopes", size = 1 } }, position = "bottom", size = 20 }, { elements = { { id = "repl", size = 1 } }, position = "right", size = 45 }, }, }, keys = { { "d", function() require("dapui").toggle({ reset = true }) end, desc = "Toggle debugger UI", }, { "e", function() require("dapui").eval() end, mode = "v", desc = "Evaluate input", }, }, }, }