-- Debuging setup for NeoVim local dap = require('dap') local dapui = require('dapui') -- -- Adapters -- dap.adapters.gdb = { type = "executable", command = "gdb", args = { "-i", "dap" } } dap.adapters.php = { type = "executable", command = "node", args = { '/usr/lib/node_modules/php-debug/out/phpDebug.js' } } -- -- Configurations -- dap.configurations.c = { { name = "Launch", type = "gdb", request = "launch", program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') end, cwd = "${workspacefolder}", }, } dap.configurations.php = { { name = "Listen for Xdebug", type = "php", request = "launch", port = 9003, }, } require("dap.ext.vscode").load_launchjs(vim.fn.getcwd() .. "/.vscode/launch.json", {}) -- Set up some keybindings vim.keymap.set('n', 'db', function() dap.toggle_breakpoint() end) vim.keymap.set('n', 'dc', function() dap.continue() end) vim.keymap.set('n', 'dr', function() dap.repl.open() end) vim.keymap.set('n', '', function() dap.step_over() end) vim.keymap.set('n', '', function() dap.step_into() end) vim.keymap.set('n', '', function() dap.step_out() end) -- Set up the UI dapui.setup() dap.listeners.before.attach.dapui_config = function() dapui.open() end dap.listeners.before.launch.dapui_config = function() dapui.open() end dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end dap.listeners.before.event_exited.dapui_config = function() dapui.close() end