local dap = require("dap") local key = require("gabrielgio.key") local dapui = require("dapui") key.nnoremap("", ":lua require'dap'.continue()") key.nnoremap("", ":lua require'dap'.step_over()") key.nnoremap("", ":lua require'dap'.step_into()") key.nnoremap("", ":lua require'dap'.step_out()") key.nnoremap("b", ":lua require'dap'.toggle_breakpoint()") key.nnoremap("B", ":lua require'dap'.set_breakpoint(vim.fn.input('Condition: '))") key.nnoremap("dr", ":lua require'dap'.repl.open()") key.nnoremap("", "lua require'dapui'.eval()") dap.adapters.delve = { type = "server", host = "127.0.0.1", port = 2345, } dap.adapters.gdb = { id = "gdb", type = "executable", command = "gdb", args = { "--interpreter=dap", "--eval-command", "set print pretty on" }, } dap.adapters.lldb = { type = "executable", command = "lldb-vscode", -- adjust as needed, must be absolute path name = "lldb", } dap.configurations.go = { { type = "delve", name = "remote", mode = "remote", request = "attach", connect = { host = "127.0.0.1", port = "2345", }, }, } dap.configurations.zig = { { name = "Launch", type = "gdb", request = "launch", program = function() return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, cwd = "${workspaceFolder}", stopAtBeginningOfMainSubprogram = false, args = function() local args_str = vim.fn.input({ prompt = "Arguments: ", }) return vim.split(args_str, " +") end, }, { name = "Launch", type = "lldb", request = "launch", program = function() return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, cwd = "${workspaceFolder}", stopAtBeginningOfMainSubprogram = false, args = function() local args_str = vim.fn.input({ prompt = "Arguments: ", }) return vim.split(args_str, " +") end, }, } dapui.setup({ layouts = { { elements = { { id = "watches", size = 1, }, }, position = "bottom", size = 10, }, }, })