From 81c703a8a18370c400dcb0e751800946eb3eac3e Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Wed, 29 Oct 2025 15:39:34 +0100 Subject: Tune dap-ui plugin --- lua/plugins/dap-ui.lua | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 lua/plugins/dap-ui.lua diff --git a/lua/plugins/dap-ui.lua b/lua/plugins/dap-ui.lua new file mode 100644 index 0000000..6df72c5 --- /dev/null +++ b/lua/plugins/dap-ui.lua @@ -0,0 +1,59 @@ +return { + "rcarriga/nvim-dap-ui", + dependencies = { + "nvim-neotest/nvim-nio", + }, + keys = { + { + "du", + function() + require("dapui").toggle({ layout = 1 }) + end, + desc = "Dap UI", + }, + }, + opts = { + layouts = { + -- Run layout + { + elements = { + { id = "repl", size = 0.20 }, + { id = "console", size = 0.80 }, + }, + size = 30, + position = "bottom", + }, + -- Debug layout + { + elements = { + { id = "scopes", size = 0.20 }, + { id = "stacks", size = 0.20 }, + { id = "console", size = 0.60 }, + }, + size = 30, + position = "bottom", + }, + }, + }, + config = function(_, opts) + require("dapui").setup(opts) + + local listener = require("dap").listeners + listener.after.event_initialized["dapui_config"] = function() + require("dapui").close() + require("dapui").toggle({ layout = 1 }) + end + listener.after.event_continued["dapui_config"] = function() + require("dapui").close() + require("dapui").toggle({ layout = 1 }) + end + listener.after.event_breakpoint["dapui_config"] = function() + require("dapui").close() + require("dapui").toggle({ layout = 2 }) + end + listener.after.event_terminated["dapui_config"] = function() + require("dapui").close() + require("dapui").toggle({ layout = 1 }) + end + end, +} -- cgit v1.2.3