local map = vim.api.nvim_set_keymap local dap = require "dap" local dapui = require "dapui" dapui.setup {} dap.adapters.lldb = { type = "executable", -- TODO: hardcoding the path here is total dog shit -- I should implement a dap module in mzte-nv that resolves this. command = "/usr/bin/lldb-vscode", -- included in lldb package name = "lldb", } dap.configurations.c = { { name = "Launch", type = "lldb", request = "launch", program = function() return vim.fn.input "Binary: " end, cwd = "${workspaceFolder}", stopOnEntry = false, args = function() local parts = {} for p in vim.split(vim.fn.input "Args: ", " ") do table.insert(parts, p) end return parts end, runInTerminal = true, }, } dap.configurations.cpp = dap.configurations.c -- TODO: maybe some way to discover the executable here with cargo n stuff? dap.configurations.rust = dap.configurations.c dap.configurations.zig = dap.configurations.c dap.configurations.java = { { type = "java", request = "attach", name = "Java attach", hostName = "127.0.0.1", port = 5005, }, } local opts = { noremap = true, silent = true } map("n", "fu", [[lua require("dapui").toggle()]], opts) map("n", "fb", [[lua require("dap").toggle_breakpoint()]], opts) map("n", "fc", [[lua require("dap").continue()]], opts) map("n", "fn", [[lua require("dap").step_over()]], opts) map("n", "fi", [[lua require("dap").step_into()]], opts) map("n", "fo", [[lua require("dap").step_out()]], opts)