diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua new file mode 100644 index 0000000..1efdc6d --- /dev/null +++ b/nvim/after/plugin/dap.lua @@ -0,0 +1,29 @@ +vim.keymap.set("n", "", function() require('dap').continue() end) +vim.keymap.set("n", 'b', function() require('dap').toggle_breakpoint() end) + +require("dap").adapters.lldb = { + type = "executable", + command = "/usr/bin/lldb-vscode", -- adjust as needed + name = "lldb", +} + +local lldb = { + name = "Launch lldb", + type = "lldb", -- matches the adapter + request = "launch", -- could also attach to a currently running process + program = function() + return vim.fn.input( + "Path to executable: ", + vim.fn.getcwd() .. "/", + "file" + ) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = {}, + runInTerminal = false, +} + +require('dap').configurations.rust = { + lldb -- different debuggers or more configurations can be used here +} \ No newline at end of file diff --git a/nvim/lua/luke-else/packer.lua b/nvim/lua/luke-else/packer.lua index 6f253cd..1c83671 100644 --- a/nvim/lua/luke-else/packer.lua +++ b/nvim/lua/luke-else/packer.lua @@ -51,4 +51,6 @@ return require('packer').startup(function(use) } } + -- Debugger + use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } end) \ No newline at end of file