return {
    {
        "mfussenegger/nvim-dap",
        dependencies = {
            "leoluz/nvim-dap-go",
            'mfussenegger/nvim-dap-python',
            "rcarriga/nvim-dap-ui",
            "nvim-neotest/nvim-nio",
        },
        config = function()
            local dap = require "dap"
            -- dap.defaults.fallback.exception_breakpoints = {'raised'}
            local ui = require "dapui"

            require("dapui").setup({
                layouts = {
                    {
                        elements = {
                            {
                                id = "breakpoints",
                                size = 0.33
                            },
                            {
                                id = "stacks",
                                size = 0.33
                            },
                            {
                                id = "scopes",
                                size = 0.33
                            },
                        },
                        position = "left",
                        size = 30
                    },
                    {
                        elements = {
                            {
                                id = "repl",
                                size = 1
                            },
                        },
                        position = "bottom",
                        size = 10
                    }
                },
            })
            require("dap-go").setup()
            require("dap-python").setup()

            vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint)
            vim.keymap.set("n", "<leader>gb", dap.run_to_cursor)

            -- Eval var under cursor
            vim.keymap.set("n", "<leader>?", function()
                require("dapui").eval(nil, { enter = true })
            end)

            vim.keymap.set("n", "<F1>", dap.continue)
            vim.keymap.set("n", "<F2>", dap.step_into)
            vim.keymap.set("n", "<F3>", dap.step_over)
            vim.keymap.set("n", "<F4>", dap.step_out)
            vim.keymap.set("n", "<F5>", dap.step_back)
            vim.keymap.set("n", "<F6>", dap.restart)

            dap.listeners.before.attach.dapui_config = function()
                ui.open()
            end
            dap.listeners.before.launch.dapui_config = function()
                ui.open()
            end
            vim.api.nvim_create_user_command("DapResetUI", function()
                ui.close()
                ui.open()
            end, {})
            vim.api.nvim_create_user_command("DapCloseUI", function()
                ui.close()
            end, {})
            vim.api.nvim_create_user_command("DapToggleUI", function()
                ui.toggle()
            end, {})
            vim.api.nvim_create_user_command("DapConditionalBreakpoint", function()
                require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))
            end, {})
            vim.api.nvim_create_user_command("DapToggleScopes", function()
                require("dapui").float_element("scopes", { enter = true, width = 250, height = 50, position = "center" })
            end, {})
            -- dap.listeners.before.event_terminated.dapui_config = function()
            --   ui.close()
            -- end
            -- dap.listeners.before.event_exited.dapui_config = function()
            --   ui.close()
            -- end
        end,
    },
}
