58 lines
2.2 KiB
Lua
58 lines
2.2 KiB
Lua
|
return {
|
||
|
"mfussenegger/nvim-dap",
|
||
|
dependencies = {
|
||
|
"rcarriga/nvim-dap-ui",
|
||
|
"nvim-neotest/nvim-nio",
|
||
|
},
|
||
|
config = function()
|
||
|
-- Setup Debugging --
|
||
|
local dap = require("dap")
|
||
|
|
||
|
-- Open UI on Debugging --
|
||
|
local dapui = require("dapui").setup()
|
||
|
dap.listeners.before.attach.dapui_config = function()
|
||
|
dapui.open()
|
||
|
end
|
||
|
dap.listeners.before.launch.dapui_config = function()
|
||
|
dapui.open()
|
||
|
end
|
||
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||
|
dapui.close()
|
||
|
end
|
||
|
dap.listeners.before.event_exited.dapui_config = function()
|
||
|
dapui.close()
|
||
|
end
|
||
|
|
||
|
-- Keybinding --
|
||
|
vim.keymap.set("n", "<Leader>db", dap.toggle_breakpoint, {})
|
||
|
vim.keymap.set("n", "<Leader>dc", dap.continue, {})
|
||
|
vim.keymap.set("n", "<Leader>dx", dap.terminate, {})
|
||
|
vim.keymap.set("n", "<Leader>ds", dap.step_over, {})
|
||
|
|
||
|
-- Breakpoints --
|
||
|
vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
|
||
|
vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
|
||
|
vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
|
||
|
vim.fn.sign_define(
|
||
|
"DapBreakpoint",
|
||
|
{ text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||
|
)
|
||
|
vim.fn.sign_define(
|
||
|
"DapBreakpointCondition",
|
||
|
{ text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||
|
)
|
||
|
vim.fn.sign_define(
|
||
|
"DapBreakpointRejected",
|
||
|
{ text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
|
||
|
)
|
||
|
vim.fn.sign_define(
|
||
|
"DapLogPoint",
|
||
|
{ text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
|
||
|
)
|
||
|
vim.fn.sign_define(
|
||
|
"DapStopped",
|
||
|
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||
|
)
|
||
|
end,
|
||
|
}
|