1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00
dotfiles/nvim/lua/plugins/ide/dap.lua

54 lines
1.5 KiB
Lua

return {
"mfussenegger/nvim-dap",
dependencies = {
{
"folke/which-key.nvim",
-- optional = true,
opts = {
defaults = {
["<leader>d"] = { name = "+debug" },
},
},
},
{
"rcarriga/nvim-dap-ui",
-- stylua: ignore
keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
},
opts = {},
config = function(_, opts)
-- setup dap config by VsCode launch.json file
-- require("dap.ext.vscode").load_launchjs()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["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
end,
},
},
keys = {
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
config = function()
-- local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
-- for name, sign in pairs(Config.icons.dap) do
-- sign = type(sign) == "table" and sign or { sign }
-- vim.fn.sign_define(
-- "Dap" .. name,
-- { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
-- )
-- end
end,
}