summaryrefslogtreecommitdiff
path: root/lua/nvim_dap
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim_dap')
-rw-r--r--lua/nvim_dap/nvim_dap.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/lua/nvim_dap/nvim_dap.lua b/lua/nvim_dap/nvim_dap.lua
new file mode 100644
index 0000000..209cab1
--- /dev/null
+++ b/lua/nvim_dap/nvim_dap.lua
@@ -0,0 +1,37 @@
+local dap = require "dap"
+local ui = require "dapui"
+
+require("dapui").setup()
+require("nvim-dap-virtual-text").setup()
+require("mason").setup()
+
+dap.adapters.codelldb = {
+ type = "executable",
+ command = "codelldb", -- or if not in $PATH: "/absolute/path/to/codelldb"
+}
+
+dap.configurations.cpp = {
+ {
+ name = "Launch file",
+ type = "codelldb",
+ request = "launch",
+ program = function()
+ return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
+ end,
+ cwd = '${workspaceFolder}',
+ stopOnEntry = false,
+ },
+}
+
+dap.listeners.before.attach.dapui_config = function()
+ ui.open()
+end
+dap.listeners.before.launch.dapui_config = function()
+ ui.open()
+end
+dap.listeners.before.event_terminated.dapui_config = function()
+ ui.close()
+end
+dap.listeners.before.event_exited.dapui_config = function()
+ ui.close()
+end