ui.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. require("dapui").setup({
  2. icons = { expanded = "", collapsed = "", current_frame = "" },
  3. mappings = {
  4. -- Use a table to apply multiple mappings
  5. expand = { "<CR>", "<2-LeftMouse>" },
  6. open = "o",
  7. remove = "d",
  8. edit = "e",
  9. repl = "r",
  10. toggle = "t",
  11. },
  12. -- Use this to override mappings for specific elements
  13. element_mappings = {
  14. -- Example:
  15. -- stacks = {
  16. -- open = "<CR>",
  17. -- expand = "o",
  18. -- }
  19. },
  20. -- Expand lines larger than the window
  21. -- Requires >= 0.7
  22. expand_lines = vim.fn.has("nvim-0.7") == 1,
  23. -- Layouts define sections of the screen to place windows.
  24. -- The position can be "left", "right", "top" or "bottom".
  25. -- The size specifies the height/width depending on position. It can be an Int
  26. -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
  27. -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
  28. -- Elements are the elements shown in the layout (in order).
  29. -- Layouts are opened in order so that earlier layouts take priority in window sizing.
  30. layouts = {
  31. {
  32. elements = {
  33. -- Elements can be strings or table with id and size keys.
  34. { id = "scopes", size = 0.25 },
  35. "breakpoints",
  36. "stacks",
  37. "watches",
  38. },
  39. size = 40, -- 40 columns
  40. position = "left",
  41. },
  42. {
  43. elements = {
  44. "repl",
  45. "console",
  46. },
  47. size = 0.25, -- 25% of total lines
  48. position = "bottom",
  49. },
  50. },
  51. controls = {
  52. -- Requires Neovim nightly (or 0.8 when released)
  53. enabled = true,
  54. -- Display controls in this element
  55. element = "repl",
  56. icons = {
  57. pause = "",
  58. play = "",
  59. step_into = "",
  60. step_over = "",
  61. step_out = "",
  62. step_back = "",
  63. run_last = "",
  64. terminate = "",
  65. },
  66. },
  67. floating = {
  68. max_height = nil, -- These can be integers or a float between 0 and 1.
  69. max_width = nil, -- Floats will be treated as percentage of your screen.
  70. border = "single", -- Border style. Can be "single", "double" or "rounded"
  71. mappings = {
  72. close = { "q", "<Esc>" },
  73. },
  74. },
  75. windows = { indent = 1 },
  76. render = {
  77. max_type_length = nil, -- Can be integer or nil.
  78. max_value_lines = 100, -- Can be integer or nil.
  79. }
  80. })
  81. local dap, dapui = require("dap"), require("dapui")
  82. dap.listeners.after.event_initialized["dapui_config"] = function()
  83. dapui.open()
  84. end
  85. -- dap.listeners.before.event_terminated["dapui_config"] = function()
  86. -- dapui.close()
  87. -- end
  88. -- dap.listeners.before.event_exited["dapui_config"] = function()
  89. -- dapui.close()
  90. -- end
  91. -- https://github.com/hood/popui.nvim
  92. vim.ui.select = require "popui.ui-overrider"
  93. vim.ui.input = require "popui.input-overrider"