return {
  'rcarriga/nvim-dap-ui',
  dependencies = {
    'mfussenegger/nvim-dap',
  },
  ft = { 'python', 'rust' },
  config = function()
    local dap = require 'dap'
    local dapui = require 'dapui'
    dapui.setup()
    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,
  vim.keymap.set('n', '<leader>db', '<cmd> DapToggleBreakpoint <CR>', { desc = '[D]ebug [B]reakpoint' }),
  vim.keymap.set('n', '<leader>dx', '<cmd> DapTerminate <CR>', { desc = '[D]ebug Terminate' }),
  vim.keymap.set('n', '<leader>dr', function()
    require('dap-python').test_method()
  end, { desc = '[D]ebug [R]un' }),
}
