Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153return { { "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 = { { "<F5>", 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", }, { "<F9>", function() require("dap").toggle_breakpoint() end, desc = "Toggle breakpoint", }, { "<F10>", function() require("dap").step_over() end, desc = "Step over", }, { "<F11>", function() require("dap").step_into() end, desc = "Step into", }, { "<F12>", function() require("dap").step_out() end, desc = "Step out", }, { "<leader>q", function() require("dap").terminate() end, desc = "Terminate debugging", }, { "<leader>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 = { { "<leader>d", function() require("dapui").toggle({ reset = true }) end, desc = "Toggle debugger UI", }, { "<leader>e", function() require("dapui").eval() end, mode = "v", desc = "Evaluate input", }, }, },}