diff options
| author | Dmitrii Morozov <dmitrii.morozov@sbb.ch> | 2025-10-29 15:39:34 +0100 | 
|---|---|---|
| committer | Dmitrii Morozov <dmitrii.morozov@sbb.ch> | 2025-10-29 15:39:34 +0100 | 
| commit | 81c703a8a18370c400dcb0e751800946eb3eac3e (patch) | |
| tree | ac3474182c0987329845674fad0738f7e32b8834 /lua | |
| parent | 0f37f1a044d0be1a8ceb7f675245a0a5307b4d6e (diff) | |
Tune dap-ui plugin
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/plugins/dap-ui.lua | 59 | 
1 files changed, 59 insertions, 0 deletions
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 = { +    { +      "<leader>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, +}  | 
