{pkgs, ...}: { plugins.dap = { enable = true; extensions = { dap-ui.enable = true; dap-go.enable = true; dap-python.enable = true; dap-virtual-text.enable = true; }; adapters = { executables = { gdb = { command = "${pkgs.gdb}/bin/gdb"; args = ["--interpreter=dap" "--eval-command" "set pretty print on"]; }; }; }; configurations = rec { c = cpp; rust = cpp; cpp = [ { name = "Launch"; request = "launch"; type = "gdb"; cwd = "\${workspaceFolder}"; stopOnEntry = false; runInTerminal = true; program = { __raw = '' get_program ''; }; } { name = "Launch with Arguments"; request = "launch"; type = "gdb"; cwd = "\${workspaceFolder}"; stopOnEntry = false; runInTerminal = true; program = { __raw = '' get_program ''; }; args = { __raw = '' function() local arguments_string = vim.fn.input('Executable arguments: ') return vim.split(arguments_string, " +") end ''; }; } ]; }; }; keymaps = [ { action = ":DapToggleBreakpoint"; key = "db"; options = { silent = true; }; } { action = ":DapUiToggle"; key = "du"; options = { silent = true; }; } { action = ":DapContinue"; key = "dc"; options = { silent = true; }; } { action = ":DapRerun"; key = "dC"; options = { silent = true; }; } { action = ":DapStepOver"; key = "do"; options = { silent = true; }; } { action = ":DapStepIn"; key = "di"; options = { silent = true; }; } { action = ":DapStepOut"; key = "dO"; options = { silent = true; }; } { action = ":DapTerminate"; key = "dT"; options = { silent = true; }; } { action = ":DapToggleRepl"; key = "dr"; options = { silent = true; }; } ]; }