-- plugins/dap.lua return { { "mfussenegger/nvim-dap", dependencies = { "rcarriga/nvim-dap-ui", "nvim-neotest/nvim-nio", -- wymagane przez dap-ui }, config = function() local dap = require("dap") local dapui = require("dapui") -- konfiguracja codelldb dla C++ dap.adapters.codelldb = { type = "server", port = "${port}", executable = { command = vim.fn.stdpath("data") .. "/mason/bin/codelldb", args = { "--port", "${port}" }, } } dap.configurations.cpp = { { name = "Launch", type = "codelldb", request = "launch", program = function() -- pyta o ścieżkę do binarki przed debugowaniem return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/build/", "file") end, cwd = "${workspaceFolder}", stopOnEntry = true, stopAtEntry = true, } } -- otwiera/zamyka UI automatycznie dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end -- bindy vim.keymap.set("n", "", dap.continue) -- start/continue vim.keymap.set("n", "", dap.step_over) -- następna linia vim.keymap.set("n", "", dap.step_into) -- wejdź w funkcję vim.keymap.set("n", "", dap.step_out) -- wyjdź z funkcji vim.keymap.set("n", "b", dap.toggle_breakpoint) -- breakpoint vim.keymap.set("n", "du", dapui.toggle) -- toggle UI dapui.setup() end } }