From b8efe23b044da9c271ca87159fa148daa908008c Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Fri, 24 Jan 2025 11:24:58 -0500 Subject: [PATCH] feat(debugging): add `nvim-dap-view` (#1332) --- .../debugging/nvim-dap-view/README.md | 5 ++++ .../debugging/nvim-dap-view/init.lua | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 lua/astrocommunity/debugging/nvim-dap-view/README.md create mode 100644 lua/astrocommunity/debugging/nvim-dap-view/init.lua diff --git a/lua/astrocommunity/debugging/nvim-dap-view/README.md b/lua/astrocommunity/debugging/nvim-dap-view/README.md new file mode 100644 index 000000000..085952e3a --- /dev/null +++ b/lua/astrocommunity/debugging/nvim-dap-view/README.md @@ -0,0 +1,5 @@ +# nvim-dap-view + +minimalistic nvim-dap-ui alternative + +**Repository:** diff --git a/lua/astrocommunity/debugging/nvim-dap-view/init.lua b/lua/astrocommunity/debugging/nvim-dap-view/init.lua new file mode 100644 index 000000000..d10c59340 --- /dev/null +++ b/lua/astrocommunity/debugging/nvim-dap-view/init.lua @@ -0,0 +1,28 @@ +return { + "igorlfs/nvim-dap-view", + lazy = true, + opts = {}, + specs = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local maps = opts.mappings + maps.n["d"] = vim.tbl_get(opts, "_map_sections", "d") + maps.n["dE"] = { function() require("dap-view").add_expr() end, desc = "Add expression" } + maps.n["du"] = { function() require("dap-view").toggle() end, desc = "Toggle Debugger UI" } + end, + }, + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = "igorlfs/nvim-dap-view", + opts = function() + local dap, dap_view = require "dap", require "dap-view" + dap.listeners.after.event_initialized.dapview_config = function() dap_view.open() end + dap.listeners.before.event_terminated.dapview_config = function() dap_view.close() end + dap.listeners.before.event_exited.dapview_config = function() dap_view.close() end + end, + }, + { "rcarriga/nvim-dap-ui", enabled = false }, + }, +}